This commit is contained in:
gazebo
2019-03-13 16:45:43 +08:00
parent 5d37250b55
commit 0f7a3ab809
2 changed files with 4 additions and 1 deletions

View File

@@ -858,7 +858,7 @@ func RefreshEbaiBadComment(ctx *jxcontext.Context, fromTime, toTime time.Time, i
globals.SugarLogger.Debugf("RefreshEbaiBadComment fromTime:%s, toTime:%s, days:%d", utils.Time2Str(fromTime), utils.Time2Str(toTime), days)
rootTask := tasksch.NewSeqTask("RefreshEbaiBadComment", ctx.GetUserName(), func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
batchFromTime := fromTime.Add(time.Duration(step) * 24 * time.Hour)
batchToTime := batchFromTime.Add(24 * time.Hour)
batchToTime := batchFromTime.Add(24*time.Hour - time.Second)
if batchToTime.Sub(toTime) > 0 {
batchToTime = toTime
}

View File

@@ -34,6 +34,9 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
if stepToTime.Sub(toTime) > 0 {
stepToTime = toTime
}
if stepToTime.Sub(stepFromTime) == 0 {
break
}
resultList, err2 := api.EbaiAPI.GetEleCommentList(stepFromTime, stepToTime, "", "", ebaiapi.ReplyStatusAll, ebaiapi.CommentLevelAll, ebaiapi.CommentContentAll)
if err = err2; err == nil {
for _, result := range resultList {