mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
Emit websocket for approval node timeout
...and update timeout_message to be more translation-friendly.
This commit is contained in:
@@ -527,11 +527,14 @@ class TaskManager():
|
|||||||
if task.timeout == 0:
|
if task.timeout == 0:
|
||||||
continue
|
continue
|
||||||
if (now - task.created) >= approval_timeout_seconds:
|
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)
|
logger.warn(timeout_message)
|
||||||
task.timed_out = True
|
task.timed_out = True
|
||||||
task.status = 'failed'
|
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'])
|
task.save(update_fields=['status', 'job_explanation', 'timed_out'])
|
||||||
|
|
||||||
def calculate_capacity_consumed(self, tasks):
|
def calculate_capacity_consumed(self, tasks):
|
||||||
|
|||||||
Reference in New Issue
Block a user