From 4a4623e1eaec501c8648382e3a1942306f0414e3 Mon Sep 17 00:00:00 2001 From: Piotr Kasprzyk <14312755+pkasprzyk@users.noreply.github.com> Date: Wed, 19 May 2021 16:15:37 +0200 Subject: [PATCH] don't crash when 0 operations are in queue on exit (#564) --- .../internal/operation_processors/async_operation_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neptune/new/internal/operation_processors/async_operation_processor.py b/neptune/new/internal/operation_processors/async_operation_processor.py index cd2a82b57..b0799318b 100644 --- a/neptune/new/internal/operation_processors/async_operation_processor.py +++ b/neptune/new/internal/operation_processors/async_operation_processor.py @@ -118,7 +118,7 @@ def _wait_for_queue_empty(self, initial_queue_size: int, seconds: Optional[float self._queue.wait_for_empty(wait_time) size_remaining = self._queue.size() already_synced = initial_queue_size - size_remaining - already_synced_proc = (already_synced / initial_queue_size) * 100 + already_synced_proc = (already_synced / initial_queue_size) * 100 if initial_queue_size else 100 if size_remaining == 0: click.echo(f"All {initial_queue_size} operations synced, thanks for waiting!") return