فهرست منبع

spider_historydata数据迁移、更新

maxiaoshan 3 سال پیش
والد
کامیت
e8d503b7a4
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 3 0
      src/logs/task.log
  2. 3 1
      src/luatask/task.go

+ 3 - 0
src/logs/task.log

@@ -702896,3 +702896,6 @@
 2022/08/19 16:45:19 task.go:1888: info  -----更新数据状态-----
 2022/08/19 16:45:19 task.go:1951: info  更新数据状态数量: 1
 2022/08/19 16:45:19 task.go:2005: info  -----更新spider_historydata数据状态完毕-----
+2022/08/22 09:41:14 task.go:1888: info  -----更新数据状态-----
+2022/08/22 09:41:14 task.go:1953: info  更新数据状态数量: 0
+2022/08/22 09:41:14 task.go:2014: info  -----更新spider_historydata数据状态完毕-----

+ 3 - 1
src/luatask/task.go

@@ -1979,7 +1979,9 @@ func ResetDataState() {
 					update = append(update, map[string]interface{}{"$set": map[string]interface{}{"delete": true}})
 				}
 			}
-			arr2 = append(arr2, update)
+			if len(update) == 2 {
+				arr2 = append(arr2, update)
+			}
 			if len(arr2) > 500 {
 				util.MgoS.UpdateBulk("spider_historydata", arr2...)
 				arr2 = [][]map[string]interface{}{}