mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-09-05 23:47:33 +08:00
fix: respect local timezone for scheduler (#54)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user