diff --git a/src/neptune_scale/api/run.py b/src/neptune_scale/api/run.py index c805a3aa..a61d847c 100644 --- a/src/neptune_scale/api/run.py +++ b/src/neptune_scale/api/run.py @@ -634,12 +634,11 @@ def _wait( if wait_seq.value >= self._operations_queue.last_sequence_id: return True - if is_closing: - if threading.current_thread() != self._closing_thread: - if verbose: - logger.warning("Waiting interrupted by run termination") + if is_closing and threading.current_thread() != self._closing_thread: + if verbose: + logger.warning("Waiting interrupted by run termination") - self._close_completed.wait(wait_time) + self._close_completed.wait(wait_time) return False