feat(agent): SIGHUP 重读节点本地配置并热重渲染,不踢在线用户

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-23 02:15:27 +08:00
parent d216e157c3
commit 6f183ff0df
3 changed files with 50 additions and 0 deletions
+5
View File
@@ -446,6 +446,11 @@ func (s *SingBox) markDirty() {
}
}
// Refresh 请求一次重渲染。供 agent 收到 SIGHUP 时调用,使编辑节点本地配置文件
// (acl.json / warp.json)后无需重启进程即可生效 —— 重启 agent 会让 sing-box 走
// 冷启动(Restart),把全部在线用户踢下线。
func (s *SingBox) Refresh() { s.markDirty() }
// Run drives the debounce loop: it coalesces bursts of changes within
// DebounceWindow into a single write+restart. It blocks until ctx is cancelled.
func (s *SingBox) Run(ctx context.Context) {