From 4eb4b401a1891c6af359abc0a58b243cf58acc19 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 23 Oct 2022 23:12:28 +0200 Subject: [PATCH] API - system info - allow 5 minutes grace before watch is considered 'overdue' --- changedetectionio/api/api_v1.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changedetectionio/api/api_v1.py b/changedetectionio/api/api_v1.py index d44c990e..40131ca5 100644 --- a/changedetectionio/api/api_v1.py +++ b/changedetectionio/api/api_v1.py @@ -141,9 +141,13 @@ class SystemInfo(Resource): # this is not super accurate (maybe they just edited it) but better than nothing t = watch.threshold_seconds() if not t: + # Use the system wide default t = self.datastore.threshold_seconds + time_since_check = time.time() - watch.get('last_checked') - if time_since_check > t: + + # Allow 5 minutes of grace time before we decide it's overdue + if time_since_check - (5 * 60) > t: overdue_watches.append(uuid) return {