新增了 问答题库管理

This commit is contained in:
2024-06-28 17:46:31 +08:00
parent 989ae25809
commit c87c7076df
20 changed files with 1313 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
package core
import (
"fmt"
"github.com/robfig/cron/v3"
"knowledge/api/crontab"
)
func StartCron() {
c := cron.New(cron.WithSeconds())
_, err := c.AddFunc("0 * * * * *", crontab.HandleQuestionQaExpire)
if err != nil {
panic("定时器启动失败:" + err.Error())
}
// 启动定时任务调度器
c.Start()
fmt.Println("初始化定时器成功......")
}