summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Rominger <arominge@redhat.com>2023-08-21 16:48:00 +0200
committerDave <dmz.oneill@gmail.com>2024-02-15 13:34:24 +0100
commit362e11aaf252c6e1b3a8113349c1dc87425349dc (patch)
tree560bf2990848982f55e93628502107c318c48711
parentUpdate command for sos-report (diff)
downloadawx-362e11aaf252c6e1b3a8113349c1dc87425349dc.tar.xz
awx-362e11aaf252c6e1b3a8113349c1dc87425349dc.zip
Respect old downtime setting name if user has already set it
-rw-r--r--awx/main/dispatch/worker/base.py2
-rw-r--r--awx/main/tasks/callback.py2
-rw-r--r--awx/main/tasks/jobs.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/awx/main/dispatch/worker/base.py b/awx/main/dispatch/worker/base.py
index 691028cd42..8a8f8dc02a 100644
--- a/awx/main/dispatch/worker/base.py
+++ b/awx/main/dispatch/worker/base.py
@@ -162,7 +162,7 @@ class AWXConsumerRedis(AWXConsumerBase):
class AWXConsumerPG(AWXConsumerBase):
def __init__(self, *args, schedule=None, **kwargs):
super().__init__(*args, **kwargs)
- self.pg_max_wait = settings.DISPATCHER_DB_DOWNTIME_TOLERANCE
+ self.pg_max_wait = getattr(settings, 'DISPATCHER_DB_DOWNTOWN_TOLLERANCE', settings.DISPATCHER_DB_DOWNTIME_TOLERANCE)
# if no successful loops have ran since startup, then we should fail right away
self.pg_is_down = True # set so that we fail if we get database errors on startup
init_time = time.time()
diff --git a/awx/main/tasks/callback.py b/awx/main/tasks/callback.py
index a8bfc53a4b..069bc408c9 100644
--- a/awx/main/tasks/callback.py
+++ b/awx/main/tasks/callback.py
@@ -29,7 +29,7 @@ class RunnerCallback:
self.safe_env = {}
self.event_ct = 0
self.model = model
- self.update_attempts = int(settings.DISPATCHER_DB_DOWNTIME_TOLERANCE / 5)
+ self.update_attempts = int(getattr(settings, 'DISPATCHER_DB_DOWNTOWN_TOLLERANCE', settings.DISPATCHER_DB_DOWNTIME_TOLERANCE) / 5)
self.wrapup_event_dispatched = False
self.artifacts_processed = False
self.extra_update_fields = {}
diff --git a/awx/main/tasks/jobs.py b/awx/main/tasks/jobs.py
index d244baa534..0a9e7f5975 100644
--- a/awx/main/tasks/jobs.py
+++ b/awx/main/tasks/jobs.py
@@ -114,7 +114,7 @@ class BaseTask(object):
def __init__(self):
self.cleanup_paths = []
- self.update_attempts = int(settings.DISPATCHER_DB_DOWNTIME_TOLERANCE / 5)
+ self.update_attempts = int(getattr(settings, 'DISPATCHER_DB_DOWNTOWN_TOLLERANCE', settings.DISPATCHER_DB_DOWNTIME_TOLERANCE) / 5)
self.runner_callback = self.callback_class(model=self.model)
def update_model(self, pk, _attempt=0, **updates):