diff --git a/internal/worker/command_blender.go b/internal/worker/command_blender.go index a9c03186..e04d62be 100644 --- a/internal/worker/command_blender.go +++ b/internal/worker/command_blender.go @@ -94,7 +94,7 @@ func (ce *CommandExecutor) cmdBlenderRender(ctx context.Context, logger zerolog. logger.Debug().Msg(line) - timestamp := time.Now().Format(timeFormat) + timestamp := ce.timeService.Now().Format(timeFormat) // %35s because trailing zeroes in the nanoseconds aren't output by the // formatted timestamp, and thus it has a variable length. Using a fixed // width in this Sprintf() call ensures the rest of the line aligns visually diff --git a/internal/worker/command_exe.go b/internal/worker/command_exe.go index 0ee67c9f..3850ba17 100644 --- a/internal/worker/command_exe.go +++ b/internal/worker/command_exe.go @@ -60,6 +60,7 @@ type CommandListener interface { // TimeService is a service that operates on time. type TimeService interface { After(duration time.Duration) <-chan time.Time + Now() time.Time } //go:generate go run github.com/golang/mock/mockgen -destination mocks/cli_runner.gen.go -package mocks gitlab.com/blender/flamenco-ng-poc/internal/worker CommandLineRunner