forked from p34709852/monkey
Island: Implement AgentSignalsService.on_terminate_agents_signal
This commit is contained in:
parent
5eeee2a60d
commit
9d3be7e1d3
|
@ -1,10 +1,13 @@
|
||||||
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from common.types import AgentID
|
from common.types import AgentID
|
||||||
from monkey_island.cc.models import AgentSignals
|
from monkey_island.cc.models import AgentSignals, Simulation
|
||||||
from monkey_island.cc.repository import IAgentRepository, ISimulationRepository
|
from monkey_island.cc.repository import IAgentRepository, ISimulationRepository
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AgentSignalsService:
|
class AgentSignalsService:
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -45,4 +48,7 @@ class AgentSignalsService:
|
||||||
|
|
||||||
:param timestamp: Timestamp of the terminate signal
|
:param timestamp: Timestamp of the terminate signal
|
||||||
"""
|
"""
|
||||||
pass
|
simulation = self._simulation_repository.get_simulation()
|
||||||
|
updated_simulation = Simulation(mode=simulation.mode, terminate_signal_time=timestamp)
|
||||||
|
|
||||||
|
self._simulation_repository.save_simulation(updated_simulation)
|
||||||
|
|
Loading…
Reference in New Issue