MCPcopy
hub / github.com/robfig/cron / AddFunc

Method AddFunc

cron.go:141–143  ·  cron.go::Cron.AddFunc

AddFunc adds a func to the Cron to be run on the given schedule. The spec is parsed using the time zone of this Cron instance as the default. An opaque ID is returned that can be used to later remove it.

(spec string, cmd func())

Source from the content-addressed store, hash-verified

139// The spec is parsed using the time zone of this Cron instance as the default.
140// An opaque ID is returned that can be used to later remove it.
141func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) {
142 return c.AddJob(spec, FuncJob(cmd))
143}
144
145// AddJob adds a Job to the Cron to be run on the given schedule.
146// The spec is parsed using the time zone of this Cron instance as the default.

Callers 15

TestWithVerboseLoggerFunction · 0.80
TestFuncPanicRecoveryFunction · 0.80
TestAddBeforeRunningFunction · 0.80
TestAddWhileRunningFunction · 0.80
TestRemoveBeforeRunningFunction · 0.80
TestRemoveWhileRunningFunction · 0.80
TestSnapshotEntriesFunction · 0.80
TestMultipleEntriesFunction · 0.80
TestRunningJobTwiceFunction · 0.80

Calls 2

AddJobMethod · 0.95
FuncJobFuncType · 0.85

Tested by 15

TestWithVerboseLoggerFunction · 0.64
TestFuncPanicRecoveryFunction · 0.64
TestAddBeforeRunningFunction · 0.64
TestAddWhileRunningFunction · 0.64
TestRemoveBeforeRunningFunction · 0.64
TestRemoveWhileRunningFunction · 0.64
TestSnapshotEntriesFunction · 0.64
TestMultipleEntriesFunction · 0.64
TestRunningJobTwiceFunction · 0.64