def start(self): from backend.tasks import ExecutionTask ExecutionTask().delay(execution_id=self.id) EventDispatcher.trigger( ExecutionStart(self.environment.application.department.id, execution=self))
def finalize(self, execution, execution_id): """ Trigger event, and save live log """ department_id = execution.environment.application.department.id EventDispatcher.trigger(ExecutionFinish(department_id, execution=execution)) ExecutionLiveLog.add(execution_id, 'execution_completed', status=execution.status, time_end=execution.time_end, time=execution.time)
def finalize(self, execution, execution_id): """ Trigger event, and save live log """ department_id = execution.environment.application.department.id EventDispatcher.trigger( ExecutionFinish(department_id, execution=execution)) ExecutionLiveLog.add(execution_id, 'execution_completed', status=execution.status, time_end=execution.time_end, time=execution.time)
def run(self, execution_id): execution = self._get_execution(execution_id) if execution.status != Execution.ABORTED: failed = False for command in execution.commands.all(): for server in command.servers.all(): if server.status in [None, server.FAILED]: failed = True if failed: execution.status = execution.FAILED else: execution.status = execution.SUCCESS execution.save_end() department_id = execution.environment.application.department.id EventDispatcher.trigger(ExecutionFinish(department_id, execution=execution)) ExecutionLiveLog.add(execution_id, 'execution_completed', status=execution.status, time_end=execution.time_end, time=execution.time)
def start(self): from backend.tasks import ExecutionTask ExecutionTask().delay(execution_id=self.id) EventDispatcher.trigger(ExecutionStart(self.environment.application.department.id, execution=self))