code: func (g *Orchestrator) handleTaskChange(ctx context.Context, t *api.Task) {
  	if _, exists := g.globalServices[t.ServiceID]; !exists {
  		return
  	}
  	// if a task's DesiredState has passed running, it
  	// means the task has been processed
  	if t.DesiredState > api.TaskStateRunning {
  		return
  	}
  
  	// if a task has passed running, restart it
  	if t.Status.State > api.TaskStateRunning {
  		g.restartTasks[t.ID] = struct{}{}
  	}
  }
docs: // handleTaskChange defines what orchestrator does when a task is updated by agent