From a69debf8ff0342e5235fa2a08d20e29c366c247d Mon Sep 17 00:00:00 2001 From: Gobinath Date: Sun, 10 Jan 2021 21:32:46 -0500 Subject: [PATCH] Fix next break being postponed forever --- safeeyes/plugins/smartpause/plugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/safeeyes/plugins/smartpause/plugin.py b/safeeyes/plugins/smartpause/plugin.py index 8a56e03..2e119e1 100644 --- a/safeeyes/plugins/smartpause/plugin.py +++ b/safeeyes/plugins/smartpause/plugin.py @@ -137,7 +137,6 @@ def __start_idle_monitor(): """ global smart_pause_activated global idle_start_time - next_break = None while __is_active(): # Wait for waiting_time seconds @@ -165,7 +164,7 @@ def __start_idle_monitor(): enable_safe_eyes(-1, idle_seconds >= long_break_duration) elif idle_seconds < short_break_interval: # Credit back the idle time - if next_break is not None: + if next_break_time is not None: # This method runs in a thread since the start. # It may run before next_break is initialized in the update_next_break method next_break = next_break_time + idle_period