fix: 修复日志格式化字符串错误和任务奖励逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -52,7 +52,7 @@ func PprofWeb() {
|
||||
}
|
||||
|
||||
// 所有端口都失败时的兜底
|
||||
errMsg := fmt.Sprintf("[FATAL] 端口9909/9910均监听失败,pprof服务启动失败")
|
||||
errMsg := "[FATAL] 端口9909/9910均监听失败,pprof服务启动失败"
|
||||
fmt.Println(errMsg)
|
||||
// 可选:根据业务需求决定是否panic
|
||||
// panic(errMsg)
|
||||
@@ -148,7 +148,7 @@ func monitorMemAndQuit() {
|
||||
|
||||
// 4. 超70%阈值,执行优雅退出
|
||||
if usedRatio >= memThresholdRatio {
|
||||
log.Fatalf("内存占比达%.1f%%,超过90%阈值,程序开始退出", usedRatio*100)
|
||||
log.Fatalf("内存占比达%.1f%%,超过90%%阈值,程序开始退出", usedRatio*100)
|
||||
// ########## 可选:这里添加你的优雅清理逻辑 ##########
|
||||
// 如:关闭数据库连接、释放文件句柄、保存业务状态、推送退出告警等
|
||||
cleanup()
|
||||
|
||||
Reference in New Issue
Block a user