lxd/cluster/upgrade.go
func KeepUpdated(state *state.State) (task.Func, task.Schedule) {
	f := func(ctx context.Context) {
		ch := make(chan struct{})
		go func() {
			maybeUpdate(state)
			close(ch)
		}()
		select {
		case <-ctx.Done():
		case <-ch:
		}
	}

	schedule := task.Every(5 * time.Minute)

	return f, schedule
}
func KeepUpdated(state *state.State) (task.Func, task.Schedule) {
	f := func(ctx context.Context) {
		ch := make(chan struct{})
		go func() {
			maybeUpdate(state)
			close(ch)
		}()
		select {
		case <-ctx.Done():
		case <-ch:
		}
	}

	schedule := task.Every(5 * time.Minute)

	return f, schedule
}
// KeepUpdated is a task that continuously monitor this node's version to see it
// it's out of date with respect to other nodes. In the node is out of date,
// and the LXD_CLUSTER_UPDATE environment variable is set, then the task
// executes the executable that the variable is pointing at.