mirror of https://gitlab.com/bashrc2/epicyon
Handle clock resets
parent
9cb89aea90
commit
727ba3da6f
|
@ -175,6 +175,9 @@ def updateBlockedCache(baseDir: str,
|
||||||
"""Updates the cache of globally blocked domains held in memory
|
"""Updates the cache of globally blocked domains held in memory
|
||||||
"""
|
"""
|
||||||
currTime = int(time.time())
|
currTime = int(time.time())
|
||||||
|
if blockedCacheLastUpdated > currTime:
|
||||||
|
print('WARN: Cache updated in the future')
|
||||||
|
blockedCacheLastUpdated = 0
|
||||||
secondsSinceLastUpdate = currTime - blockedCacheLastUpdated
|
secondsSinceLastUpdate = currTime - blockedCacheLastUpdated
|
||||||
if secondsSinceLastUpdate < blockedCacheUpdateSecs:
|
if secondsSinceLastUpdate < blockedCacheUpdateSecs:
|
||||||
return blockedCacheLastUpdated
|
return blockedCacheLastUpdated
|
||||||
|
|
Loading…
Reference in New Issue