Worker: use time service to log current time
This commit is contained in:
parent
66186e460e
commit
45a95ca4c2
@ -94,7 +94,7 @@ func (ce *CommandExecutor) cmdBlenderRender(ctx context.Context, logger zerolog.
|
|||||||
|
|
||||||
logger.Debug().Msg(line)
|
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
|
// %35s because trailing zeroes in the nanoseconds aren't output by the
|
||||||
// formatted timestamp, and thus it has a variable length. Using a fixed
|
// 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
|
// width in this Sprintf() call ensures the rest of the line aligns visually
|
||||||
|
@ -60,6 +60,7 @@ type CommandListener interface {
|
|||||||
// TimeService is a service that operates on time.
|
// TimeService is a service that operates on time.
|
||||||
type TimeService interface {
|
type TimeService interface {
|
||||||
After(duration time.Duration) <-chan time.Time
|
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
|
//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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user