mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-09-05 23:49:56 +08:00
fix(agent): 修复 webhook 路由 Python 严格缩进错误导致的进程崩溃问题
This commit is contained in:
+12
-12
@@ -242,18 +242,18 @@ class AgentHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Log transmission failed: {e}")
|
print(f"Log transmission failed: {e}")
|
||||||
|
|
||||||
# ================== [v4.0.0 新增: 触发深海声呐] ==================
|
# ================== [v4.0.0 新增: 触发深海声呐] ==================
|
||||||
elif req_path == '/trigger_quality':
|
elif req_path == '/trigger_quality':
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header("Content-type", "text/plain")
|
self.send_header("Content-type", "text/plain")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(b"Action Accepted: trigger_quality\n")
|
self.wfile.write(b"Action Accepted: trigger_quality\n")
|
||||||
|
|
||||||
script_path = '/opt/ip_sentinel/core/mod_quality.sh'
|
script_path = '/opt/ip_sentinel/core/mod_quality.sh'
|
||||||
if os.path.exists(script_path):
|
if os.path.exists(script_path):
|
||||||
# 使用 Popen 且丢弃输入输出,实现绝对的异步脱离,不阻塞 Webhook 主线程
|
# 使用 Popen 且丢弃输入输出,实现绝对的异步脱离,不阻塞 Webhook 主线程
|
||||||
subprocess.Popen(['bash', script_path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
subprocess.Popen(['bash', script_path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
# =================================================================
|
# =================================================================
|
||||||
|
|
||||||
|
|
||||||
# 路由 5: 节点重命名展示别名同步接口 (Base64 终极防御版)
|
# 路由 5: 节点重命名展示别名同步接口 (Base64 终极防御版)
|
||||||
|
|||||||
Reference in New Issue
Block a user