Make resources the only direct user of psutil

This commit is contained in:
Ingo Oppermann
2024-10-29 12:25:39 +01:00
parent fbf62bf7e5
commit 2ee7fa7e41
10 changed files with 279 additions and 182 deletions

View File

@@ -38,13 +38,20 @@ func getDummyRestreamer(portrange net.Portranger, validatorIn, validatorOut ffmp
return nil, err
}
resources, err := resources.New(resources.Config{
PSUtil: psutil,
})
if err != nil {
return nil, err
}
ffmpeg, err := ffmpeg.New(ffmpeg.Config{
Binary: binary,
LogHistoryLength: 3,
Portrange: portrange,
ValidatorInput: validatorIn,
ValidatorOutput: validatorOut,
PSUtil: psutil,
Resource: resources,
})
if err != nil {
return nil, err
@@ -88,13 +95,6 @@ func getDummyRestreamer(portrange net.Portranger, validatorIn, validatorOut ffmp
return nil, err
}
resources, err := resources.New(resources.Config{
PSUtil: psutil,
})
if err != nil {
return nil, err
}
rs, err := New(Config{
FFmpeg: ffmpeg,
Replace: replacer,