feat(scheduler): 30s polling scheduler with pure NextRun/dueTaskIDs
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/vasyansk/imap-copier/internal/config"
|
||||
"github.com/vasyansk/imap-copier/internal/httpapi"
|
||||
"github.com/vasyansk/imap-copier/internal/orchestrator"
|
||||
"github.com/vasyansk/imap-copier/internal/scheduler"
|
||||
"github.com/vasyansk/imap-copier/internal/store"
|
||||
"github.com/vasyansk/imap-copier/internal/wshub"
|
||||
)
|
||||
@@ -45,6 +46,8 @@ func main() {
|
||||
orch := orchestrator.New(st, hub, cfg.EncKey, cfg.WorkerConcurrency)
|
||||
srv := httpapi.NewServer(cfg, st, orch, hub)
|
||||
|
||||
go scheduler.New(st, orch).Start(context.Background())
|
||||
|
||||
slog.Info("listening", "addr", cfg.HTTPAddr)
|
||||
if err := http.ListenAndServe(cfg.HTTPAddr, srv.Router()); err != nil {
|
||||
slog.Error("serve", "err", err)
|
||||
|
||||
Reference in New Issue
Block a user