diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 0c0cca9cc..c720fe46a 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -237,13 +237,13 @@ class InfectionMonkey(object): if not self._keep_running: break - InfectionMonkey.run_ransomware() - if (not is_empty) and (WormConfiguration.max_iterations > iteration_index + 1): time_to_sleep = WormConfiguration.timeout_between_iterations LOG.info("Sleeping %d seconds before next life cycle iteration", time_to_sleep) time.sleep(time_to_sleep) + InfectionMonkey.run_ransomware() + if self._keep_running and WormConfiguration.alive: LOG.info("Reached max iterations (%d)", WormConfiguration.max_iterations) elif not WormConfiguration.alive: