mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Merge pull request #5728 from wenottingham/i-waited-for-days
Fix timedelta comparison to account for large intervals Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -341,7 +341,7 @@ def gather_analytics():
|
|||||||
return
|
return
|
||||||
last_time = settings.AUTOMATION_ANALYTICS_LAST_GATHER
|
last_time = settings.AUTOMATION_ANALYTICS_LAST_GATHER
|
||||||
gather_time = now()
|
gather_time = now()
|
||||||
if not last_time or ((gather_time - last_time).seconds > settings.AUTOMATION_ANALYTICS_GATHER_INTERVAL):
|
if not last_time or ((gather_time - last_time).total_seconds() > settings.AUTOMATION_ANALYTICS_GATHER_INTERVAL):
|
||||||
with advisory_lock('gather_analytics_lock', wait=False) as acquired:
|
with advisory_lock('gather_analytics_lock', wait=False) as acquired:
|
||||||
if acquired is False:
|
if acquired is False:
|
||||||
logger.debug('Not gathering analytics, another task holds lock')
|
logger.debug('Not gathering analytics, another task holds lock')
|
||||||
|
|||||||
Reference in New Issue
Block a user