mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-10-02 15:14:01 +00:00
chore(cluster): 去掉 restart 的重复日志行
实测 .30 在处理一个 restart 任务时打出两条完全相同的 `restarted t4: portal→aliyun-frps:4434`(同毫秒、同内容),一度像是执行了两次。 核实 worker 进程只有一个(restart 对已运行进程是幂等的),所以不是重复执行 —— 是引擎层(ring_engine.go)与应用层(RestartFn)各打了一条同样的日志。 保留应用层那条:它紧跟实际 worker 操作(谁真正把进程拉起来的),信息位置更准; 引擎层只保留 discard/no-owner 这类异常路径的日志,一次重启对应一行。 go build / go vet / go test ./... 全绿。
This commit is contained in:
@ -544,8 +544,9 @@ func (e *Engine) runCommands(ctx context.Context, tk *Token) error {
|
||||
"taskId": claimed.ID, "local": claimed.Local.Name, "remote": claimed.Remote.Name,
|
||||
})
|
||||
}
|
||||
log.Printf("ring[%s] restarted %s: %s→%s:%d", e.ID, claimed.ID,
|
||||
claimed.Local.Name, claimed.Remote.Name, claimed.Link.RemotePort)
|
||||
// Logging is the app's job (RestartFn reports the actual worker
|
||||
// outcome); the ring layer stays quiet so one restart is one line
|
||||
// rather than two identical ones.
|
||||
continue
|
||||
}
|
||||
if e.Handler != nil {
|
||||
|
||||
Reference in New Issue
Block a user