MCPcopy
hub / github.com/tuna/tunasync / AddJob

Method AddJob

worker/schedule.go:50–60  ·  view source on GitHub ↗
(schedTime time.Time, job *mirrorJob)

Source from the content-addressed store, hash-verified

48}
49
50func (q *scheduleQueue) AddJob(schedTime time.Time, job *mirrorJob) {
51 q.Lock()
52 defer q.Unlock()
53 if _, ok := q.jobs[job.Name()]; ok {
54 logger.Warningf("Job %s already scheduled, removing the existing one", job.Name())
55 q.unsafeRemove(job.Name())
56 }
57 q.jobs[job.Name()] = true
58 q.list.Set(schedTime, job)
59 logger.Debugf("Added job %s @ %v", job.Name(), schedTime)
60}
61
62// pop out the first job if it's time to run it
63func (q *scheduleQueue) Pop() *mirrorJob {

Callers 3

TestScheduleFunction · 0.80
ReloadMirrorConfigMethod · 0.80
runScheduleMethod · 0.80

Calls 5

unsafeRemoveMethod · 0.95
WarningfMethod · 0.80
DebugfMethod · 0.80
NameMethod · 0.65
SetMethod · 0.45

Tested by 1

TestScheduleFunction · 0.64