mirror of
https://github.com/usual2970/certimate.git
synced 2025-09-21 15:36:01 +00:00
init
This commit is contained in:
19
internal/utils/app/schedule.go
Normal file
19
internal/utils/app/schedule.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tools/cron"
|
||||
)
|
||||
|
||||
var schedulerOnce sync.Once
|
||||
|
||||
var scheduler *cron.Cron
|
||||
|
||||
func GetScheduler() *cron.Cron {
|
||||
schedulerOnce.Do(func() {
|
||||
scheduler = cron.New()
|
||||
})
|
||||
|
||||
return scheduler
|
||||
}
|
Reference in New Issue
Block a user