Browse Source

动态打印长度

龚成明 3 years ago
parent
commit
a1429ed6d6
1 changed files with 6 additions and 1 deletions
  1. 6 1
      scripts/path/level2Generate.ts

+ 6 - 1
scripts/path/level2Generate.ts

@@ -6,6 +6,7 @@ class Level2Generate {
   maxMemoryOfByte: number = 0
   maxMemoryChanged: boolean = true
   lpSumObj: any = {}
+  prevTypeLpListLength: number = 0
 
   buildLpObj (lpList: any) {
     for (const lp of lpList) {
@@ -33,7 +34,11 @@ class Level2Generate {
 
   buildSumObjGroupBySum2(allTypeLpList: any) {
     // 根据sum值进行池子分类
-    logger.debug(`generate sum group by sum...${allTypeLpList.length}`)
+    if (this.prevTypeLpListLength != allTypeLpList.length){
+      logger.debug(`generate sum group by sum...${allTypeLpList.length}`)
+      this.prevTypeLpListLength = allTypeLpList.lengthOf
+    }
+
     for (const lpDbObj of allTypeLpList) {
       const newLp: any = {}
       newLp.factory = lpDbObj.dataObj.factory