Пример #1
0
 def update_action_log(cls, task, al_instance=None):
     try:
         if not al_instance:
             al_instance = ActionLog.get_by_task_uuid(task.uuid)
         if al_instance:
             update_data = {
                 "end_timestamp": datetime.datetime.utcnow(),
                 "additional_info": {
                     "ended_with_status": task.status,
                     "message": "",
                     "output":
                     cls.sanitize_task_output(task.cache, al_instance)
                 }
             }
             ActionLog.update(al_instance, update_data)
     except Exception as e:
         logger.error("update_action_log failed: %s", six.text_type(e))
Пример #2
0
 def update_action_log(cls, task, al_instance=None):
     try:
         if not al_instance:
             al_instance = ActionLog.get_by_task_uuid(task.uuid)
         if al_instance:
             update_data = {
                 "end_timestamp": datetime.datetime.utcnow(),
                 "additional_info": {
                     "ended_with_status": task.status,
                     "message": task.message,
                     "output": cls.sanitize_task_output(task.cache,
                                                        al_instance)
                 }
             }
             ActionLog.update(al_instance, update_data)
     except Exception as e:
         logger.error("update_action_log failed: %s", six.text_type(e))