This commit is contained in:
Tomas Dvorak
2026-02-22 15:41:27 +01:00
parent 0b88627e54
commit 409acd2e08
84 changed files with 65382 additions and 27475 deletions
+5 -2
View File
@@ -3,6 +3,7 @@ package scheduler
import (
"context"
"fmt"
"time"
"github.com/robfig/cron/v3"
@@ -49,9 +50,11 @@ func (s *Scheduler) Start(ctx context.Context) error {
schedule = "@every " + s.config.Interval.String()
}
s.cron.AddFunc(schedule, func() {
if _, err := s.cron.AddFunc(schedule, func() {
s.syncAll(ctx)
})
}); err != nil {
return fmt.Errorf("failed to schedule sync job: %w", err)
}
s.cron.Start()
return nil