MCPcopy Create free account
hub / github.com/DoNewsCode/core / Remove

Method Remove

cron/cron.go:89–98  ·  view source on GitHub ↗

Remove removes a job from the cron scheduler.

(id JobID)

Source from the content-addressed store, hash-verified

87
88// Remove removes a job from the cron scheduler.
89func (c *Cron) Remove(id JobID) {
90 c.lock.L.Lock()
91 defer c.lock.L.Unlock()
92
93 for i, descriptor := range c.jobDescriptors {
94 if descriptor.ID == id {
95 heap.Remove(&c.jobDescriptors, i)
96 }
97 }
98}
99
100// Descriptors returns a list of all job descriptors.
101func (c *Cron) Descriptors() []JobDescriptor {

Callers 6

TestC_DefaultFunction · 0.80
NewCleanupCommandFunction · 0.80
TestCron_remove_jobFunction · 0.80
TestKoanfAdapter_WatchFunction · 0.80
tearDownFunction · 0.80
TestWatchFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestC_DefaultFunction · 0.64
TestCron_remove_jobFunction · 0.64
TestKoanfAdapter_WatchFunction · 0.64
tearDownFunction · 0.64
TestWatchFunction · 0.64