From 727ba3da6ff5875e778426fc7bdbc42480b8a97b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 21 Jun 2021 10:40:43 +0100 Subject: [PATCH] Handle clock resets --- blocking.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blocking.py b/blocking.py index abdb5309a..53346c136 100644 --- a/blocking.py +++ b/blocking.py @@ -175,6 +175,9 @@ def updateBlockedCache(baseDir: str, """Updates the cache of globally blocked domains held in memory """ currTime = int(time.time()) + if blockedCacheLastUpdated > currTime: + print('WARN: Cache updated in the future') + blockedCacheLastUpdated = 0 secondsSinceLastUpdate = currTime - blockedCacheLastUpdated if secondsSinceLastUpdate < blockedCacheUpdateSecs: return blockedCacheLastUpdated