From bc6df9cab8ed8514a1d26bd821a33c8549088bd8 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 27 Mar 2019 10:47:38 -0400 Subject: [PATCH 1/2] Make use of user-defined settings for defining the isolated nodes heartbeat Just in case the user has created custom settings files which set AWX_ISOLATED_PERIODIC_CHECK. --- awx/settings/development.py | 9 +++++++++ awx/settings/production.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/awx/settings/development.py b/awx/settings/development.py index 1b32e54e20..020cd9d99d 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -142,6 +142,15 @@ except ImportError: traceback.print_exc() sys.exit(1) + +CELERYBEAT_SCHEDULE.update({ # noqa + 'isolated_heartbeat': { + 'task': 'awx.main.tasks.awx_isolated_heartbeat', + 'schedule': timedelta(seconds=AWX_ISOLATED_PERIODIC_CHECK), # noqa + 'options': {'expires': AWX_ISOLATED_PERIODIC_CHECK * 2}, # noqa + } +}) + CLUSTER_HOST_ID = socket.gethostname() try: diff --git a/awx/settings/production.py b/awx/settings/production.py index 7c114f99eb..ea611d7438 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -107,3 +107,12 @@ except IOError: raise ImproperlyConfigured(msg) else: raise + + +CELERYBEAT_SCHEDULE.update({ # noqa + 'isolated_heartbeat': { + 'task': 'awx.main.tasks.awx_isolated_heartbeat', + 'schedule': timedelta(seconds=AWX_ISOLATED_PERIODIC_CHECK), # noqa + 'options': {'expires': AWX_ISOLATED_PERIODIC_CHECK * 2}, # noqa + } +}) From e398a0ac5e88df7b6ccb770d89c348c4d32859f1 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 27 Mar 2019 14:12:42 -0400 Subject: [PATCH 2/2] Remove the isolated_heartbeat setup from settings/defaults.py --- awx/settings/defaults.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 9fdf03163f..5254ef4e99 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -491,11 +491,7 @@ CELERYBEAT_SCHEDULE = { 'schedule': timedelta(seconds=20), 'options': {'expires': 20} }, - 'isolated_heartbeat': { - 'task': 'awx.main.tasks.awx_isolated_heartbeat', - 'schedule': timedelta(seconds=AWX_ISOLATED_PERIODIC_CHECK), - 'options': {'expires': AWX_ISOLATED_PERIODIC_CHECK * 2}, - } + # 'isolated_heartbeat': set up at the end of production.py and development.py } AWX_INCONSISTENT_TASK_INTERVAL = 60 * 3