From 7e6e35c4453181ab29c28d143de8a3b544a16ff3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 07:18:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lightning_app/components/serve/auto_scaler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lightning_app/components/serve/auto_scaler.py b/src/lightning_app/components/serve/auto_scaler.py index 7d0114069f7976..36ae720ae8943a 100644 --- a/src/lightning_app/components/serve/auto_scaler.py +++ b/src/lightning_app/components/serve/auto_scaler.py @@ -185,13 +185,13 @@ async def send_batch(self, batch: List[Tuple[str, _BatchRequestModel]]): async def consumer(self): while True: await asyncio.sleep(0.05) - batch = self._batch[:self.max_batch_size] + batch = self._batch[: self.max_batch_size] is_batch_ready = len(batch) == self.max_batch_size is_batch_timeout = time.time() - self._last_batch_sent > self.timeout_batching if batch and (is_batch_ready or is_batch_timeout): asyncio.create_task(self.send_batch(batch)) # resetting the batch array, TODO - not locking the array - self._batch = self._batch[len(batch):] + self._batch = self._batch[len(batch) :] self._last_batch_sent = time.time() async def process_request(self, data: BaseModel):