This commit is contained in:
2025-09-15 21:17:57 +08:00
parent 524da0830a
commit 413ac308ac
9 changed files with 394 additions and 26 deletions
+8
View File
@@ -81,3 +81,11 @@ func WorkerCount() int {
}
return n
}
// SetWorkers 运行时更新 worker 数量(用于从数据库读取配置后覆盖文件配置)。
func SetWorkers(workers int) {
if workers < 0 {
workers = 0
}
appConfig.Workers = workers
}