mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:02:25 -05:00
[chore] Add media-ffmpeg-pool-size config var (#3164)
This commit is contained in:
parent
09f239d7e3
commit
fa59c3713c
7 changed files with 77 additions and 4 deletions
|
|
@ -487,16 +487,24 @@ func setLimits(ctx context.Context) {
|
|||
}
|
||||
|
||||
func precompileWASM(ctx context.Context) error {
|
||||
// TODO: make max number instances configurable
|
||||
maxprocs := runtime.GOMAXPROCS(0)
|
||||
if err := sqlite3.Initialize(); err != nil {
|
||||
return gtserror.Newf("error compiling sqlite3: %w", err)
|
||||
}
|
||||
if err := ffmpeg.InitFfmpeg(ctx, maxprocs); err != nil {
|
||||
|
||||
// Use admin-set ffmpeg pool size, and fall
|
||||
// back to GOMAXPROCS if number 0 or less.
|
||||
ffPoolSize := config.GetMediaFfmpegPoolSize()
|
||||
if ffPoolSize <= 0 {
|
||||
ffPoolSize = runtime.GOMAXPROCS(0)
|
||||
}
|
||||
|
||||
if err := ffmpeg.InitFfmpeg(ctx, ffPoolSize); err != nil {
|
||||
return gtserror.Newf("error compiling ffmpeg: %w", err)
|
||||
}
|
||||
if err := ffmpeg.InitFfprobe(ctx, maxprocs); err != nil {
|
||||
|
||||
if err := ffmpeg.InitFfprobe(ctx, ffPoolSize); err != nil {
|
||||
return gtserror.Newf("error compiling ffprobe: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue