mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-11 07:46:37 +08:00
fix: cap CPU and avoid heavy startup work
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user