From 9d3d4611dcc5eb9ebe33d15bc08e97b8869594d8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 29 Jun 2021 06:38:56 -0400 Subject: [PATCH] agent: Define _manage_telemetry_batches_thread in __init_() --- .../telemetry/messengers/batching_telemetry_messenger.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py b/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py index f47d5392e..aa4351567 100644 --- a/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py +++ b/monkey/infection_monkey/telemetry/messengers/batching_telemetry_messenger.py @@ -45,6 +45,8 @@ class BatchingTelemetryMessenger(ITelemetryMessenger): self._last_sent_time = time.time() self._telemetry_batches: Dict[str, IBatchableTelem] = {} + self._manage_telemetry_batches_thread = None + def start(self): self._should_run_batch_thread = True self._manage_telemetry_batches_thread = threading.Thread( @@ -55,6 +57,7 @@ class BatchingTelemetryMessenger(ITelemetryMessenger): def stop(self): self._should_run_batch_thread = False self._manage_telemetry_batches_thread.join() + self._manage_telemetry_batches_thread = None def _manage_telemetry_batches(self): self._reset()