代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/sysSentry 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3e2721852ad1f8047ad219a5ab6c68fd4c9d6f5c Mon Sep 17 00:00:00 2001
From: shixuantong <shixuantong1@huawei.com>
Date: Wed, 24 Jul 2024 16:17:54 +0800
Subject: [PATCH] Fix the problem that function cpu_report_result() is called
more than once
when task is running, user to exec "sentryctl stop cpu_sentry", cpu_report_result() will be called twice. This will cause the log to be printed twice
---
src/python/syssentry/cpu_sentry.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/python/syssentry/cpu_sentry.py b/src/python/syssentry/cpu_sentry.py
index 7e77654..3c4d58d 100644
--- a/src/python/syssentry/cpu_sentry.py
+++ b/src/python/syssentry/cpu_sentry.py
@@ -133,6 +133,7 @@ class CpuSentry:
result_level = self.send_result.get("result", ResultLevel.FAIL)
report_result(task_name, result_level, details)
+ self.init_send_result()
def kill_process(signum, _f, cpu_sentry_obj):
"""kill process by 'pkill -9'"""
@@ -179,6 +180,6 @@ def main():
cpu_sentry_task.send_result["result"] = ResultLevel.FAIL
cpu_sentry_task.send_result["details"]["code"] = 1004
cpu_sentry_task.send_result["details"]["msg"] = "run cmd [%s] raise Error" % cpu_sentry_task_cmd
- finally:
cpu_sentry_task.cpu_report_result()
- cpu_sentry_task.init_send_result()
+ else:
+ cpu_sentry_task.cpu_report_result()
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。