|
@@ -84,10 +84,12 @@ func (this *CustomManager) GetData(userId, keyWords string, isNew bool) map[stri
|
|
|
// ScheduledTasks 定时任务
|
|
|
func (this *CustomManager) ScheduledTasks() {
|
|
|
if this.Conf.UpdateCron != "" {
|
|
|
+ c := cron.New(cron.WithSeconds())
|
|
|
// 给对象增加定时任务
|
|
|
- if _, err := cron.New().AddFunc(this.Conf.UpdateCron, this.UpdateUserGroupJob); err != nil {
|
|
|
+ if _, err := c.AddFunc(this.Conf.UpdateCron, this.UpdateUserGroupJob); err != nil {
|
|
|
panic(err)
|
|
|
}
|
|
|
+ c.Run()
|
|
|
}
|
|
|
//首次运行圈选用户
|
|
|
this.UpdateUserGroupJob()
|