fix(archied): report schedules apply status at start and on a timer
This commit is contained in:
1 parent
8ff629e74e
commit
2df9af9734
2 files changed
+7
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user