From 2df9af973482668eee435709ff08cd74474ebc6e Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 13 Oct 2026 19:08:55 +1100 Subject: [PATCH] fix(archied): report schedules apply status at start and on a timer --- internal/app/archied/main.go | 1 + internal/app/controlplane/client.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/internal/app/archied/main.go b/internal/app/archied/main.go index 6f9f78b13..27d4b2c8c 100644 --- a/internal/app/archied/main.go +++ b/internal/app/archied/main.go @@ -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 { diff --git a/internal/app/controlplane/client.go b/internal/app/controlplane/client.go index 18d63ebfe..bdaf8a7ef 100644 --- a/internal/app/controlplane/client.go +++ b/internal/app/controlplane/client.go @@ -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 {