Merge pull request #11933 from AlanCoding/settingify

Add setting for notification job status retry loop
This commit is contained in:
Shane McDonald 2022-03-24 13:55:39 -04:00 committed by GitHub
commit c06ced93f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -846,7 +846,7 @@ def handle_work_error(task_id, *args, **kwargs):
def handle_success_and_failure_notifications(job_id):
uj = UnifiedJob.objects.get(pk=job_id)
retries = 0
while retries < 5:
while retries < settings.AWX_NOTIFICATION_JOB_FINISH_MAX_RETRY:
if uj.finished:
uj.send_notification_templates('succeeded' if uj.status == 'successful' else 'failed')
return

View File

@ -983,6 +983,9 @@ BROADCAST_WEBSOCKET_NEW_INSTANCE_POLL_RATE_SECONDS = 10
# How often websocket process will generate stats
BROADCAST_WEBSOCKET_STATS_POLL_RATE_SECONDS = 5
# Number of times to retry sending a notification when waiting on a job to finish.
AWX_NOTIFICATION_JOB_FINISH_MAX_RETRY = 5
DJANGO_GUID = {'GUID_HEADER_NAME': 'X-API-Request-Id'}
# Name of the default task queue