|
@@ -2,8 +2,10 @@ package services
|
|
|
|
|
|
import (
|
|
import (
|
|
"context"
|
|
"context"
|
|
|
|
+ "eta/eta_task/models/rag"
|
|
"eta/eta_task/utils"
|
|
"eta/eta_task/utils"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "time"
|
|
)
|
|
)
|
|
|
|
|
|
type WechatArticleOp struct {
|
|
type WechatArticleOp struct {
|
|
@@ -39,18 +41,18 @@ func AddWechatArticleOpToCache(wechatPlatformId int, source string) bool {
|
|
// @param cont context.Context
|
|
// @param cont context.Context
|
|
// @return err error
|
|
// @return err error
|
|
func RefreshWechatPlatform(cont context.Context) (err error) {
|
|
func RefreshWechatPlatform(cont context.Context) (err error) {
|
|
- //utils.FileLog.Debug("RefreshWechatPlatform:", time.Now().Format(utils.FormatDateTime))
|
|
|
|
- //obj := new(rag.WechatPlatform)
|
|
|
|
- //platformList, tmpErr := obj.GetListByCondition(` AND enabled = 1 `, []interface{}{}, 0, 100000)
|
|
|
|
- //if tmpErr != nil {
|
|
|
|
- // err = tmpErr
|
|
|
|
- // return
|
|
|
|
- //}
|
|
|
|
- //
|
|
|
|
- //for _, v := range platformList {
|
|
|
|
- // AddWechatArticleOpToCache(v.WechatPlatformId, "refresh")
|
|
|
|
- // time.Sleep(1 * time.Minute)
|
|
|
|
- //}
|
|
|
|
|
|
+ utils.FileLog.Debug("RefreshWechatPlatform:", time.Now().Format(utils.FormatDateTime))
|
|
|
|
+ obj := new(rag.WechatPlatform)
|
|
|
|
+ platformList, tmpErr := obj.GetListByCondition(` AND enabled = 1 `, []interface{}{}, 0, 100000)
|
|
|
|
+ if tmpErr != nil {
|
|
|
|
+ err = tmpErr
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, v := range platformList {
|
|
|
|
+ AddWechatArticleOpToCache(v.WechatPlatformId, "refresh")
|
|
|
|
+ time.Sleep(1 * time.Minute)
|
|
|
|
+ }
|
|
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|