refactor(handler): 重构runner及checker架构

This commit is contained in:
mei
2026-06-06 19:31:16 +08:00
parent 7c4fb1e1d8
commit 7957a91609
13 changed files with 405 additions and 19 deletions
+7 -4
View File
@@ -12,9 +12,16 @@ import (
"github.com/ssdomei232/goodBaby/api/rule"
"github.com/ssdomei232/goodBaby/api/user"
"github.com/ssdomei232/goodBaby/handler/checker"
"github.com/ssdomei232/goodBaby/handler/runner"
)
func main() {
runner.InitExecutorRegistry()
c := cron.New()
c.AddFunc("@every 10m", checker.CheckTimers)
c.Start()
r := gin.Default()
store := cookie.NewStore(generateRandomKey(32))
r.Use(sessions.Sessions("goodbaby-session", store))
@@ -40,10 +47,6 @@ func main() {
}
r.Run(":8088")
c := cron.New()
c.AddFunc("@every 10m", checker.CheckTimers)
c.Start()
}
func generateRandomKey(length int) []byte {