mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 19:37:38 -02:30
log when notifications fail to send
* If a job does not finish in the 5 second timeout. Let the user know that we failed to even try to send the notification.
This commit is contained in:
@@ -609,7 +609,7 @@ def handle_success_and_failure_notifications(job_id):
|
||||
while retries < 5:
|
||||
if uj.finished:
|
||||
uj.send_notification_templates('succeeded' if uj.status == 'successful' else 'failed')
|
||||
break
|
||||
return
|
||||
else:
|
||||
# wait a few seconds to avoid a race where the
|
||||
# events are persisted _before_ the UJ.status
|
||||
@@ -618,6 +618,8 @@ def handle_success_and_failure_notifications(job_id):
|
||||
time.sleep(1)
|
||||
uj = UnifiedJob.objects.get(pk=job_id)
|
||||
|
||||
logger.warn(f"Failed to even try to send notifications for job '{uj}' due to job not being in finished state.")
|
||||
|
||||
|
||||
@task(queue=get_local_queuename)
|
||||
def update_inventory_computed_fields(inventory_id):
|
||||
|
||||
Reference in New Issue
Block a user