MCPcopy Create free account
hub / github.com/astercloud/aster / Clear

Method Clear

pkg/core/scheduler.go:304–317  ·  view source on GitHub ↗

Clear 清空所有任务

()

Source from the content-addressed store, hash-verified

302
303// Clear 清空所有任务
304func (s *Scheduler) Clear() {
305 s.mu.Lock()
306 defer s.mu.Unlock()
307
308 // 停止所有时间间隔任务
309 for _, task := range s.intervalTasks {
310 close(task.stopCh)
311 }
312
313 // 清空
314 s.stepTasks = make(map[string]*StepTask)
315 s.stepListeners = make([]StepCallback, 0)
316 s.intervalTasks = make(map[string]*IntervalTask)
317}
318
319// Shutdown 关闭调度器
320func (s *Scheduler) Shutdown() {

Callers 2

ShutdownMethod · 0.95
TestScheduler_ClearFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestScheduler_ClearFunction · 0.76