Просмотр исходного кода

pass batchsize to recountAndUpdateDescendantCountOfPages

yohei0125 3 лет назад
Родитель
Сommit
e4cdcf8b24
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/server/service/page.ts

+ 2 - 2
packages/app/src/server/service/page.ts

@@ -3070,7 +3070,7 @@ class PageService {
     builder.addConditionToSortPagesByDescPath();
     builder.addConditionToSortPagesByDescPath();
 
 
     const aggregatedPages = await builder.query.lean().cursor({ batchSize: BATCH_SIZE });
     const aggregatedPages = await builder.query.lean().cursor({ batchSize: BATCH_SIZE });
-    await this.recountAndUpdateDescendantCountOfPages(aggregatedPages);
+    await this.recountAndUpdateDescendantCountOfPages(aggregatedPages, BATCH_SIZE);
   }
   }
 
 
   /**
   /**
@@ -3086,7 +3086,7 @@ class PageService {
     builder.addConditionToSortPagesByDescPath(); // sort in DESC
     builder.addConditionToSortPagesByDescPath(); // sort in DESC
 
 
     const aggregatedPages = await builder.query.lean().cursor({ batchSize: BATCH_SIZE });
     const aggregatedPages = await builder.query.lean().cursor({ batchSize: BATCH_SIZE });
-    await this.recountAndUpdateDescendantCountOfPages(aggregatedPages);
+    await this.recountAndUpdateDescendantCountOfPages(aggregatedPages, BATCH_SIZE);
   }
   }
 
 
   /**
   /**