agent: Extract default period to constant

This commit is contained in:
Mike Salvatore 2021-06-28 11:15:46 -04:00
parent 85c91f55bb
commit 13c9e41a4c
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ from infection_monkey.telemetry.i_batchable_telem import IBatchableTelem
from infection_monkey.telemetry.i_telem import ITelem from infection_monkey.telemetry.i_telem import ITelem
from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger
DEFAULT_PERIOD = 5
WAKES_PER_PERIOD = 4 WAKES_PER_PERIOD = 4
@ -16,7 +17,7 @@ class BatchingTelemetryMessenger(ITelemetryMessenger):
and periodically sends them to Monkey Island. and periodically sends them to Monkey Island.
""" """
def __init__(self, telemetry_messenger: ITelemetryMessenger, period=5): def __init__(self, telemetry_messenger: ITelemetryMessenger, period=DEFAULT_PERIOD):
self._telemetry_messenger = telemetry_messenger self._telemetry_messenger = telemetry_messenger
self._period = period self._period = period