refactor: clean code

This commit is contained in:
Fu Diwei
2024-12-23 19:31:48 +08:00
parent d509445519
commit 9ef16ebcf9
6 changed files with 21 additions and 9 deletions

View File

@@ -7,10 +7,10 @@ import (
"github.com/pocketbase/pocketbase/tools/cron"
)
var schedulerOnce sync.Once
var scheduler *cron.Cron
var schedulerOnce sync.Once
func GetScheduler() *cron.Cron {
schedulerOnce.Do(func() {
scheduler = cron.New()