mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
Update websockets for pending approvals, change timeout expiration to
This commit is contained in:
parent
7814592285
commit
f6f6e5883a
@ -1173,7 +1173,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
|
||||
|
||||
def websocket_emit_data(self):
|
||||
''' Return extra data that should be included when submitting data to the browser over the websocket connection '''
|
||||
websocket_data = dict()
|
||||
websocket_data = dict(type=self.get_real_instance_class()._meta.verbose_name.replace(' ', '_'))
|
||||
if self.spawned_by_workflow:
|
||||
websocket_data.update(dict(workflow_job_id=self.workflow_job_id,
|
||||
workflow_node_id=self.workflow_node_id))
|
||||
|
||||
@ -685,7 +685,7 @@ class WorkflowApproval(UnifiedJob):
|
||||
self.status = 'successful'
|
||||
self.save()
|
||||
changes = model_to_dict(self, model_serializer_mapping())
|
||||
changes['status']=['pending', 'successful']
|
||||
changes['status'] = ['pending', 'successful']
|
||||
activity_entry = ActivityStream(
|
||||
operation='update',
|
||||
object1='workflow_approval',
|
||||
@ -702,7 +702,7 @@ class WorkflowApproval(UnifiedJob):
|
||||
self.status = 'failed'
|
||||
self.save()
|
||||
changes = model_to_dict(self, model_serializer_mapping())
|
||||
changes['status']=['pending', 'failed']
|
||||
changes['status'] = ['pending', 'failed']
|
||||
activity_entry = ActivityStream(
|
||||
operation='update',
|
||||
object1='workflow_approval',
|
||||
|
||||
@ -527,7 +527,7 @@ class TaskManager():
|
||||
if task.timeout == 0:
|
||||
continue
|
||||
if (now - task.created) >= approval_timeout_seconds:
|
||||
logger.info("The approval node {} ({}) has expired after {} seconds.".format(task.name, task.pk, task.timeout))
|
||||
logger.warn("The approval node {} ({}) has expired after {} seconds.".format(task.name, task.pk, task.timeout))
|
||||
task.timed_out = True
|
||||
task.status = 'failed'
|
||||
task.job_explanation = _("This approval node has timed out.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user