fix: cap CPU and avoid heavy startup work

This commit is contained in:
ShukeBta
2026-06-11 19:48:00 +08:00
parent d9f87c61b6
commit 7274ea19b7
13 changed files with 230 additions and 35 deletions
+10
View File
@@ -49,6 +49,16 @@ func ApplyRuntimeSetting(cfg *config.Config, key, value string) {
}
cfg.App.FFprobeMaxConcurrent = n
}
case "app.max_cpu_threads", "runtime.max_cpu_threads":
if n, err := strconv.Atoi(value); err == nil {
if n < 1 {
n = 1
}
if n > 8 {
n = 8
}
cfg.App.MaxCPUThreads = n
}
case "transcode.enabled", "transcoder.enabled":
cfg.Transcoder.Enabled = parseBoolSetting(value, true)
case "transcode.hw_enabled", "transcoder.hardware_accel":