diff --git a/sharded_queue/__init__.py b/sharded_queue/__init__.py index 22c8a32..634a51a 100644 --- a/sharded_queue/__init__.py +++ b/sharded_queue/__init__.py @@ -234,7 +234,8 @@ async def process(self, tube: Tube, limit: Optional[int] = None) -> int: batch_size = instance.batch_size() if batch_size is None: batch_size = self.settings.batch_size - batch_size = min(limit, batch_size) + if limit is not None: + batch_size = min(limit, batch_size) processed = False for pipe in pipes: msgs = await storage.range(pipe, batch_size)