mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Fix issue where only one NT attached to UJT would be used to send notifications
This commit is contained in:
@@ -484,7 +484,11 @@ class JobNotificationMixin(object):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise NotImplementedError("build_notification_message() does not exist" % status)
|
raise NotImplementedError("build_notification_message() does not exist" % status)
|
||||||
|
|
||||||
def send_it():
|
# Use kwargs to force late-binding
|
||||||
send_notifications.delay([nt.generate_notification(notification_subject, notification_body).id],
|
# https://stackoverflow.com/a/3431699/10669572
|
||||||
job_id=self.id)
|
def send_it(local_nt=nt, local_subject=notification_subject, local_body=notification_body):
|
||||||
connection.on_commit(send_it)
|
def _func():
|
||||||
|
send_notifications.delay([local_nt.generate_notification(local_subject, local_body).id],
|
||||||
|
job_id=self.id)
|
||||||
|
return _func
|
||||||
|
connection.on_commit(send_it())
|
||||||
|
|||||||
Reference in New Issue
Block a user