Merge pull request #8221 from beeankha/job_timeout_notification_bugfix

Enable "On Fail" Notifications to Send Upon Timeout of Job Templates

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-09-24 13:53:04 +00:00
committed by GitHub

View File

@@ -1506,6 +1506,8 @@ class BaseTask(object):
self.instance.job_explanation = "Job terminated due to timeout"
status = 'failed'
extra_update_fields['job_explanation'] = self.instance.job_explanation
# ensure failure notification sends even if playbook_on_stats event is not triggered
handle_success_and_failure_notifications.apply_async([self.instance.job.id])
except InvalidVirtualenvError as e:
extra_update_fields['job_explanation'] = e.message