From b85361732be4fd4db9ba6457fc1e9967eacfb6b2 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 28 Feb 2017 12:53:59 -0500 Subject: [PATCH] Revert "emit job status over socket after database commit" This reverts commit edefeeacdaf11cf484a4b4893ee9acde5ef85390. --- awx/main/models/unified_jobs.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 7744f27821..f17b2b4c55 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -964,13 +964,10 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique # Save the pending status, and inform the SocketIO listener. self.update_fields(start_args=json.dumps(kwargs), status='pending') + self.websocket_emit_status("pending") - def post_commit(): - from awx.main.scheduler.tasks import run_job_launch - self.websocket_emit_status("pending") - run_job_launch.delay(self.id) - - connection.on_commit(post_commit) + from awx.main.scheduler.tasks import run_job_launch + connection.on_commit(lambda: run_job_launch.delay(self.id)) # Each type of unified job has a different Task class; get the # appropirate one.