MCPcopy
hub / github.com/pocketbase/pocketbase / SetInterval

Method SetInterval

tools/cron/cron.go:48–59  ·  view source on GitHub ↗

SetInterval changes the current cron tick interval (it usually should be >= 1 minute).

(d time.Duration)

Source from the content-addressed store, hash-verified

46// SetInterval changes the current cron tick interval
47// (it usually should be >= 1 minute).
48func (c *Cron) SetInterval(d time.Duration) {
49 // update interval
50 c.mux.Lock()
51 wasStarted := c.ticker != nil
52 c.interval = d
53 c.mux.Unlock()
54
55 // restart the ticker
56 if wasStarted {
57 c.Start()
58 }
59}
60
61// SetTimezone changes the current cron tick timezone.
62func (c *Cron) SetTimezone(l *time.Location) {

Callers 2

TestCronSetIntervalFunction · 0.80
TestCronStartStopFunction · 0.80

Calls 1

StartMethod · 0.95

Tested by 2

TestCronSetIntervalFunction · 0.64
TestCronStartStopFunction · 0.64