From b2a0b3fc29be34f9d4815bc479b7e6071248f6d6 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 21 Jan 2020 16:14:33 -0500 Subject: [PATCH] Fix timedelta comparison to account for large intervals It would fail if you set the interval to > 1 day. --- awx/main/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index a99e547f26..d14be8f8bd 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -341,7 +341,7 @@ def gather_analytics(): return last_time = settings.AUTOMATION_ANALYTICS_LAST_GATHER 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: if acquired is False: logger.debug('Not gathering analytics, another task holds lock')