fix: update current_time calculation to use local timezone in cache validation

This commit is contained in:
Théophile Diot 2024-11-19 14:03:39 +01:00
parent 750587fe2d
commit 8a66783ff4
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -144,7 +144,7 @@ class Job:
try:
cache_info = self.get_cache(name, job_name=job_name, service_id=service_id, plugin_id=plugin_id, with_info=True, with_data=False)
if isinstance(cache_info, dict):
current_time = datetime.now().timestamp()
current_time = datetime.now().astimezone().timestamp()
if current_time < cache_info["last_update"]:
return False
is_cached = current_time - cache_info["last_update"] < EXPIRE_TIME[expire]