Explorar el Código

feat:修改监控

zhaohaipeng hace 5 días
padre
commit
ba911f2ab8
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. 9 3
      monitor/supply_workflow_monitor.py

+ 9 - 3
monitor/supply_workflow_monitor.py

@@ -82,13 +82,19 @@ def task_exe_step_stat(ts: int, workflow_id: str, workflow_name: str):
                                 when status = 1 then '运行中'
                                 when status = 2 then '成功'
                                 when status = 3 then '失败'
+                                when swt.task_status = 0 then '初始化'
+                                when swt.task_status = 1 then '运行中'
+                                when swt.task_status = 2 then '成功'
+                                when swt.task_status = 3 then '失败'
                                 else '未知' end AS status,
                             case
                                 when swtes.error_msg like '%Data too long%' then '数据超过字段长度限制'
                                 when swtes.error_msg like '%Deadlock%' then '数据库死锁'
-                                when (swtes.error_msg = '' or swtes.error_msg is null) then ''
-                                else substring_index(swtes.error_msg, ',', 1)
-                                end             AS error_msg
+                                when (swtes.error_msg <> '' and swtes.error_msg is not null) then substring_index(swtes.error_msg, ',', 1)
+                                when swt.error_msg like '%Data too long%' then '数据超过字段长度限制'
+                                when swt.error_msg like '%Deadlock%' then '数据库死锁'
+                                when (swt.error_msg <> '' AND swt.error_msg is not null) then substring_index(swt.error_msg, ',', 1)
+                                else '' end  AS error_msg
                      from supply_workflow_task swt
                               left join supply_workflow_task_exe_step swtes on swt.task_id = swtes.task_id
                      where swt.create_timestamp >= {ts}