fix: respect local timezone for scheduler (#54)

This commit is contained in:
Wu Qing
2026-05-01 14:39:16 +08:00
committed by GitHub
parent 63fde903d2
commit af0e8f5c1f
2 changed files with 35 additions and 1 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ type Service struct {
func NewService(tasks repository.BackupTaskRepository, runner TaskRunner, logger *zap.Logger) *Service {
parser := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
return &Service{
cron: cron.New(cron.WithParser(parser), cron.WithLocation(time.UTC)),
cron: cron.New(cron.WithParser(parser), cron.WithLocation(time.Local)),
tasks: tasks,
runner: runner,
logger: logger,