Worker: also log found Blender at startup
Similar to the logging of the found FFmpeg, log the version of Blender at Worker startup.
This commit is contained in:
parent
377583c9e2
commit
4947712bec
@ -1,11 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io/fs"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"git.blender.org/flamenco/internal/find_blender"
|
||||
"git.blender.org/flamenco/internal/find_ffmpeg"
|
||||
)
|
||||
|
||||
@ -21,3 +24,22 @@ func findFFmpeg() {
|
||||
log.Info().Str("path", result.Path).Str("version", result.Version).Msg("FFmpeg found on this system")
|
||||
}
|
||||
}
|
||||
|
||||
// findBlender tries to find Blender, in order to show its version (if found) or a message (if not).
|
||||
func findBlender() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result, err := find_blender.Find(ctx)
|
||||
switch {
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
log.Warn().Msg("Blender could not be found, Flamenco Manager will have to supply a full path")
|
||||
case err != nil:
|
||||
log.Warn().Err(err).Msg("there was an unexpected error finding Blender on this system, Flamenco Manager will have to supply a full path")
|
||||
default:
|
||||
log.Info().
|
||||
Str("path", result.FoundLocation).
|
||||
Str("version", result.BlenderVersion).
|
||||
Msg("Blender found on this system, it will be used unless Flamenco Manager specifies a path to a different Blender")
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ func main() {
|
||||
configWrangler.SetManagerURL(url)
|
||||
}
|
||||
|
||||
findBlender()
|
||||
findFFmpeg()
|
||||
|
||||
// Give the auto-discovery some time to find a Manager.
|
||||
|
Loading…
x
Reference in New Issue
Block a user