From 543f0031a24222c742dd16f46c67acbe43eec169 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 28 Jun 2021 12:34:24 -0400 Subject: [PATCH] agent: Fully flush BatchingTelemetryMessenger queue before stopping --- .../telemetry/messengers/batching_telemetry_messenger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py b/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py index 9541d34d1..252a5e8a7 100644 --- a/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py +++ b/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py @@ -57,7 +57,7 @@ class BatchingTelemetryMessenger(ITelemetryMessenger): def _manage_telemetry_batches(self): self._reset() - while self._should_run_batch_thread: + while self._should_run_batch_thread or not self._queue.empty(): try: telemetry = self._queue.get(block=True, timeout=self._period / WAKES_PER_PERIOD)