Skip to content

Commit 16ec256

Browse files
committed
batch size optional limit check
1 parent 2af4e9d commit 16ec256

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sharded_queue/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ async def process(self, tube: Tube, limit: Optional[int] = None) -> int:
234234
batch_size = instance.batch_size()
235235
if batch_size is None:
236236
batch_size = self.settings.batch_size
237-
batch_size = min(limit, batch_size)
237+
if limit is not None:
238+
batch_size = min(limit, batch_size)
238239
processed = False
239240
for pipe in pipes:
240241
msgs = await storage.range(pipe, batch_size)

0 commit comments

Comments
 (0)