浏览代码

wip:定时任务配置

wangshan 1 年之前
父节点
当前提交
a8b281ee32
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 2 2
      rpc/partnerlib/crontab/service/service.go
  2. 5 4
      rpc/partnerlib/internal/config/crontab.go

+ 2 - 2
rpc/partnerlib/crontab/service/service.go

@@ -177,12 +177,12 @@ func DocsClassUpdate(cron config.Cron) {
 // 合作商会员信息更新,每天一点开始
 func UpdateDocsUserMemberTask(ctx context.Context) {
 	defer common.Catch()
-	cron.CrontabByTicker(ctx, Cron.UpdateDocsClass, DocsUserMemberUpdate)
+	cron.CrontabByTicker(ctx, Cron.UpdateDocsMember, DocsUserMemberUpdate)
 }
 
 func DocsUserMemberUpdate(cron config.Cron) {
 	log.Println("update docs user member state task start :", date.NowFormat(date.Date_Full_Layout), cron)
-	//获取分类详情
+	//直接更新合作商会员状态
 	if err := DocsUserMember(); err != nil {
 		log.Println("合作商会员信息更新 定时任务异常: ", err.Error())
 	}

+ 5 - 4
rpc/partnerlib/internal/config/crontab.go

@@ -1,10 +1,11 @@
 package config
 
 type CrontabInfo struct {
-	IsRun           bool
-	NewDocsList     Cron
-	UpdateDocsList  Cron
-	UpdateDocsClass Cron
+	IsRun            bool
+	NewDocsList      Cron
+	UpdateDocsList   Cron
+	UpdateDocsClass  Cron
+	UpdateDocsMember Cron
 }
 
 type Cron struct {