Skip to content

Commit 58bd6b2

Browse files
committed
feat: trigger initial scheduler dispatch when backend configs are present
1 parent e5c05e2 commit 58bd6b2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

plugins/compliance-orchestrator/scheduler/scheduler.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ func StartScheduler(ctx context.Context, backend *client.BackendClient) {
1616

1717
ticker := time.NewTicker(24 * time.Hour)
1818

19+
configs, err := backend.GetControlConfigs(ctx)
20+
if err == nil {
21+
catcher.Info("Scheduler: sending configs", map[string]any{
22+
"cantidad": len(configs),
23+
"timestamp": time.Now().String(),
24+
})
25+
26+
for _, cfg := range configs {
27+
Jobs <- cfg
28+
}
29+
}
30+
1931
for {
2032
select {
2133
case <-ctx.Done():

0 commit comments

Comments
 (0)