From d3dd6ffeb0e3bc98cc46fa21430421cb2666983b Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 10 Feb 2022 09:13:09 -0500 Subject: [PATCH] Agent: Simplify logic in Timer.time_remaining --- monkey/infection_monkey/utils/timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/utils/timer.py b/monkey/infection_monkey/utils/timer.py index 597eb6020..2ed17d551 100644 --- a/monkey/infection_monkey/utils/timer.py +++ b/monkey/infection_monkey/utils/timer.py @@ -36,7 +36,7 @@ class Timer: :rtype: float """ time_remaining = self._timeout_sec - (time.time() - self._start_time) - return time_remaining if time_remaining > 0 else 0 + return max(time_remaining, 0) def reset(self): """