mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Emit websocket for approval node timeout
...and update timeout_message to be more translation-friendly.
This commit is contained in:
parent
9571801e9f
commit
2fc7e93c6a
@ -527,11 +527,14 @@ class TaskManager():
|
||||
if task.timeout == 0:
|
||||
continue
|
||||
if (now - task.created) >= approval_timeout_seconds:
|
||||
timeout_message = "The approval node {} ({}) has expired after {} seconds.".format(task.name, task.pk, task.timeout)
|
||||
timeout_message = _(
|
||||
"The approval node {name} ({pk}) has expired after {timeout} seconds."
|
||||
).format(name=task.name, pk=task.pk, timeout=task.timeout)
|
||||
logger.warn(timeout_message)
|
||||
task.timed_out = True
|
||||
task.status = 'failed'
|
||||
task.job_explanation = _(timeout_message)
|
||||
task.websocket_emit_status(task.status)
|
||||
task.job_explanation = timeout_message
|
||||
task.save(update_fields=['status', 'job_explanation', 'timed_out'])
|
||||
|
||||
def calculate_capacity_consumed(self, tasks):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user