diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 708d92a59..f621dc3ec 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -254,7 +254,7 @@ class InfectionMonkey: propagation_credentials_repository ), ) - event_queue.subscribe_all_events(SendAllAgentEventsToIsland(server_address)) + event_queue.subscribe_all_events(SendAllAgentEventsToIsland(server_address).send_event) @staticmethod def _get_local_network_interfaces() -> List[IPv4Interface]: diff --git a/monkey/infection_monkey/send_all_events_to_island.py b/monkey/infection_monkey/send_all_events_to_island.py index 7d3e04280..668f508e0 100644 --- a/monkey/infection_monkey/send_all_events_to_island.py +++ b/monkey/infection_monkey/send_all_events_to_island.py @@ -29,7 +29,7 @@ class SendAllAgentEventsToIsland: ) self._send_to_island_thread.start() - def __call__(self, event: AbstractAgentEvent): + def send_event(self, event: AbstractAgentEvent): self._queue.put(self._serialize_event(event)) logger.debug( f"Sending event of type {type(event).__name__} to the Island at {self._server_address}"