fix(archied): report schedules apply status at start and on a timer

This commit is contained in:
sam committed 2026-10-13 19:08:55 +11:00
1 parent f67e8a3e3f
commit c77d44def6
2 files changed
+7

No files matched your search

+1
View File
@@ -209,6 +209,7 @@ func Run() int { //nolint:cyclop,funlen // the composition root's setup sequence
b.buildDaemon()
b.playbooks.Keep(ctx, playbookRefreshInterval)
b.workflowDefinitions.Keep(ctx, playbookRefreshInterval)
b.controlPlane.KeepSchedules(ctx, playbookRefreshInterval)
b.wireConfigSurfaces(ctx, args.cfgPath, args.overlayPath)
if err := b.startServices(ctx); err != nil {
+6
View File
@@ -247,6 +247,12 @@ func sendUpdate[T any](ctx context.Context, out chan<- T, update T) bool {
}
}
// KeepSchedules reads the schedules now and every interval after, so the apply
// status is reported before the scheduler first polls.
func (c *Client) KeepSchedules(ctx context.Context, interval time.Duration) {
keepLoading(ctx, interval, func() { _, _, _ = c.Schedules(ctx) })
}
func (c *Client) Schedules(ctx context.Context) ([]scheduling.JobSpec, int64, error) {
response, err := c.rpc.Query(ctx, &pb.QueryRequest{Kind: SchedulesKind})
if err != nil {