python工程,kafka消息对接转换成配置文件并完成类似看门狗监控linux系统进程,定期清理日志
wangrong
2025-04-05 88f9100edcba9581214c1a0acc23cd33a821a9c6
update the Gate start always
1个文件已修改
10 ■■■■■ 已修改文件
main.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.py
@@ -284,21 +284,13 @@
        try:
            current_time = datetime.now()
            current_hour = current_time.hour
            if stop_start_hour <= current_hour < stop_end_hour:
                logging.info("Within 00:00 - 05:00, stopping all monitored processes.")
                for process in process_list:
                    process_name = process.get("process_name")
                    if not process_name or process_name=="Gate":
                        continue
                if stop_start_hour <= current_hour < stop_end_hour and process_name!="Gate":
                    pids = get_process_pids(process_name)
                    if pids:
                        stop_process(pids)
            else:
                for process in process_list:
                    process_name = process.get("process_name")
                    if not process_name:
                        continue
                    pids = get_process_pids(process_name)
                    if not pids:
                        logging.warning(f"Process {process_name} is not running, starting...")