fix: limit ffprobe concurrency

This commit is contained in:
ShukeBta
2026-06-09 19:18:21 +08:00
parent 7d7f3cc758
commit bfb0243712
7 changed files with 174 additions and 31 deletions
+3
View File
@@ -260,6 +260,9 @@ func updateSettingHandler(svc *service.Container) gin.HandlerFunc {
_ = svc.Repo.DB.WithContext(c.Request.Context()).Model(&model.User{}).Where("hide_adult = ?", false).Update("hide_adult", true).Error
}
service.ApplyRuntimeSetting(svc.Cfg, req.Key, req.Value)
if svc.FFprobe != nil && (req.Key == "ffprobe.max_concurrent" || req.Key == "app.ffprobe_max_concurrent") {
svc.FFprobe.SetMaxConcurrent(svc.Cfg.App.FFprobeMaxConcurrent)
}
if req.Key == "transcode.enabled" && !svc.Cfg.Transcoder.Enabled {
svc.Transcoder.StopAll()
}
+1
View File
@@ -72,6 +72,7 @@ func schemaHandler(_ *service.Container) gin.HandlerFunc {
{"key": "transcode.idle_timeout_seconds", "type": "number", "label": "转码空闲停止秒数"},
{"key": "ffmpeg.path", "type": "text", "label": "FFmpeg 路径"},
{"key": "ffprobe.path", "type": "text", "label": "FFprobe 路径"},
{"key": "ffprobe.max_concurrent", "type": "number", "label": "FFprobe 最大并发"},
},
},
{