// Tell scheduler to trigger an implicit task reconciliation.
358369
func (p *AuroraAdminClient) TriggerImplicitTaskReconciliation(ctx context.Context) (r *Response, err error) {
  var _args348 AuroraAdminTriggerImplicitTaskReconciliationArgs
  var _result349 AuroraAdminTriggerImplicitTaskReconciliationResult
  if err = p.Client_().Call(ctx, "triggerImplicitTaskReconciliation", &_args348, &_result349); err != nil {
    return
  }
  return _result349.GetSuccess(), nil
}
1206404
func (s *TickScheduler) Tick(now int64) {
	s.schedulerMu.Lock()
	defer s.schedulerMu.Unlock()

	if s.ctx == nil {
		return
	}

	select {
	case <-s.ctx.Done():
		return
	default:
		// do nothing and allow ticks
	}

	atomic.StoreInt64(&s.now, now)

	affected := 0
	for _, ts := range s.taskSchedulers {
		if nextDue, hasQueue := ts.NextDue(); now >= nextDue || hasQueue {
			ts.Work()
			affected++
		}
	}
	// TODO(mr): find a way to emit a more useful / less annoying tick message, maybe aggregated over the past 10s or 30s?
	s.logger.Debug("Ticked", zap.Int64("now", now), zap.Int("tasks_affected", affected))
}
154933
func (w *Worker) ScheduleCancel(scheduleId string) (err error) {
	_, err = w.schedules(scheduleId, "cancel").Request("POST", nil)
	return
}
445234
func (p *AuroraAdminClient) TriggerExplicitTaskReconciliation(ctx context.Context, settings *ExplicitReconciliationSettings) (r *Response, err error) {
  var _args346 AuroraAdminTriggerExplicitTaskReconciliationArgs
  _args346.Settings = settings
  var _result347 AuroraAdminTriggerExplicitTaskReconciliationResult
  if err = p.Client_().Call(ctx, "triggerExplicitTaskReconciliation", &_args346, &_result347); err != nil {
    return
  }
  return _result347.GetSuccess(), nil
}
1115264
func (api *ServicesAPI) TriggerMaintenance(id string) (task *Task, err error) {
	body := []byte{}
	res, err := api.client.restClient.Post(
		api.client.Endpoint+serviceUrl+id+"/trigger_maintenance",
		"application/json",
		bytes.NewReader(body),
		api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	task, err = getTask(getError(res))
	return
}
399979
func (s *CreateCrawlerInput) SetSchedule(v string) *CreateCrawlerInput {
	s.Schedule = &v
	return s
}
1189137
func trigger(c context.Context, t tasks.Task, q *datastore.Query) error {
	tasks := make([]*tq.Task, 0)
	newPayload := payloadFactory(t)
	addTask := func(k *datastore.Key) {
		tasks = append(tasks, &tq.Task{
			Payload: newPayload(k.StringID()),
		})
	}
	if err := datastore.Run(c, q, addTask); err != nil {
		return errors.Annotate(err, "failed to fetch keys").Err()
	}
	logging.Debugf(c, "scheduling %d tasks", len(tasks))
	if err := getDispatcher(c).AddTask(c, tasks...); err != nil {
		return errors.Annotate(err, "failed to schedule tasks").Err()
	}
	return nil
}
809328
func NewScheduler(size uint) *LatchesScheduler {
	latches := NewLatches(size)
	unlockCh := make(chan *Lock, lockChanSize)
	scheduler := &LatchesScheduler{
		latches:  latches,
		unlockCh: unlockCh,
		closed:   false,
	}
	go scheduler.run()
	return scheduler
}
563571
func (s *DatasetTrigger) SetSchedule(v *Schedule) *DatasetTrigger {
	s.Schedule = v
	return s
}
902773
func (s *Trigger) SetSchedule(v string) *Trigger {
	s.Schedule = &v
	return s
}
855644
func (sm *schedulerMetrics) ClaimTask(succeeded bool) {
	status := statusString(succeeded)

	sm.claimsComplete.WithLabelValues(status).Inc()
	if succeeded {
		sm.claimsActive.Inc()
	}
}
951535
func (s *MaintenanceWindowIdentity) SetSchedule(v string) *MaintenanceWindowIdentity {
	s.Schedule = &v
	return s
}
302795
func (m *Matcher) addScheduler(idx uint) {
	if _, ok := m.schedulers[idx]; ok {
		return
	}
	m.schedulers[idx] = newScheduler(idx)
}
724143
func Transform(s Scheduler, fn func(*Manifest) *Manifest) Scheduler {
	return &transformer{s, fn}
}
419199
func (scheduler *LatchesScheduler) Close() {
	scheduler.RWMutex.Lock()
	defer scheduler.RWMutex.Unlock()
	if !scheduler.closed {
		close(scheduler.unlockCh)
		scheduler.closed = true
	}
}
513913
func (cli *OpsGenieClient) ScheduleOverrideV2() (*OpsGenieScheduleOverrideV2Client, error) {
	cli.makeHTTPTransportSettings()

	scheduleOverrideClient := new(OpsGenieScheduleOverrideV2Client)
	scheduleOverrideClient.SetOpsGenieClient(*cli)

	if cli.opsGenieAPIURL == "" {
		scheduleOverrideClient.SetOpsGenieAPIUrl(endpointURL)
	}

	return scheduleOverrideClient, nil
}
335665
func (s *UpdateCrawlerInput) SetSchedule(v string) *UpdateCrawlerInput {
	s.Schedule = &v
	return s
}