MCPcopy
hub / github.com/pocketbase/pocketbase / New

Function New

tools/cron/cron.go:37–44  ·  view source on GitHub ↗

New create a new Cron struct with default tick interval of 1 minute and timezone in UTC. You can change the default tick interval with Cron.SetInterval(). You can change the default timezone with Cron.SetTimezone().

()

Source from the content-addressed store, hash-verified

35// You can change the default tick interval with Cron.SetInterval().
36// You can change the default timezone with Cron.SetTimezone().
37func New() *Cron {
38 return &Cron{
39 interval: 1 * time.Minute,
40 timezone: time.UTC,
41 jobs: []*Job{},
42 tickerDone: make(chan bool),
43 }
44}
45
46// SetInterval changes the current cron tick interval
47// (it usually should be >= 1 minute).

Callers 10

NewBaseAppFunction · 0.92
TestCronNewFunction · 0.70
TestCronSetIntervalFunction · 0.70
TestCronSetTimezoneFunction · 0.70
TestCronAddAndRemoveFunction · 0.70
TestCronMustAddFunction · 0.70
TestCronRemoveAllFunction · 0.70
TestCronTotalFunction · 0.70
TestCronJobsFunction · 0.70
TestCronStartStopFunction · 0.70

Calls

no outgoing calls

Tested by 9

TestCronNewFunction · 0.56
TestCronSetIntervalFunction · 0.56
TestCronSetTimezoneFunction · 0.56
TestCronAddAndRemoveFunction · 0.56
TestCronMustAddFunction · 0.56
TestCronRemoveAllFunction · 0.56
TestCronTotalFunction · 0.56
TestCronJobsFunction · 0.56
TestCronStartStopFunction · 0.56