forked from p15670423/monkey
Island: Fix agent stopping bugs
2 bugs fixed: UI used miliseconds instead of seconds and island kept stopping monkeys, but it should only stop monkey once to not prevent more runs
This commit is contained in:
parent
1c79efc941
commit
1d74864092
|
@ -29,7 +29,12 @@ def should_agent_die(guid: int) -> bool:
|
|||
|
||||
|
||||
def _should_agent_stop(monkey: Monkey) -> bool:
|
||||
return monkey.config.should_stop
|
||||
if monkey.config.should_stop:
|
||||
# Only stop the agent once, to allow further runs on that machine
|
||||
monkey.config.should_stop = False
|
||||
monkey.save()
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _is_monkey_killed_manually(monkey: Monkey) -> bool:
|
||||
|
|
|
@ -88,10 +88,11 @@ class MapPageComponent extends AuthComponent {
|
|||
{
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({kill_time: Date.now()})
|
||||
// Python uses seconds, Date.now uses milliseconds, so convert
|
||||
body: JSON.stringify({kill_time: Date.now() / 1000})
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => {this.setState({killPressed: true}); console.log(res)});
|
||||
.then(res => {this.setState({killPressed: true})});
|
||||
};
|
||||
|
||||
renderKillDialogModal = () => {
|
||||
|
|
Loading…
Reference in New Issue