Selaa lähdekoodia

移除不必要字段,报错提示

skyfffire 2 vuotta sitten
vanhempi
commit
5a413b949d
2 muutettua tiedostoa jossa 10 lisäystä ja 3 poistoa
  1. 4 1
      scripts/lib/lp-lib.js
  2. 6 2
      scripts/maintenance/index.js

+ 4 - 1
scripts/lib/lp-lib.js

@@ -150,7 +150,7 @@ module.exports = class LpLib {
     // 生成所有lp的hash
     const hashList = this.getHashListByLpList(lpList)
     // 以段为单位,更新r0、r1。每一段有SIZE个元素
-    const SIZE = 2000
+    const SIZE = 600
     for (let from = 0; from < hashList.length; from += SIZE) {
       logger.debug(`${from}, ${hashList.length}`)
 
@@ -164,6 +164,9 @@ module.exports = class LpLib {
         const lp = lpList[index]
         const relativeIndex = index % SIZE
 
+        lp.appendTimestamp = undefined
+        lp.updateTimestamp = undefined
+
         lp.r0Str = r0s[relativeIndex]
         lp.r0 = parseInt(lp.r0Str)
 

+ 6 - 2
scripts/maintenance/index.js

@@ -36,10 +36,14 @@ class LpMaintenance {
     }
     // 6. 更新池子到数据库
     for (const v2Lp of v2LpList) {
-      await this.lpLib.v2LpModel.appendOrUpdate(v2Lp)
+      const rst = await this.lpLib.v2LpModel.appendOrUpdate(v2Lp)
+
+      if (!rst.state) logger.info(rst)
     }
     for (const v3Lp of v3LpList) {
-      await this.lpLib.v3LpModel.appendOrUpdate(v3Lp)
+      const rst = await this.lpLib.v3LpModel.appendOrUpdate(v3Lp)
+
+      if (!rst.state) logger.info(rst)
     }
   }