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

use autoUpdateExpiryDate in renameSubOperation

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

+ 11 - 1
packages/app/src/server/service/page.ts

@@ -564,8 +564,18 @@ class PageService {
 
 
     const exParentId = page.parent;
     const exParentId = page.parent;
 
 
+    const timerObj = this.crowi.pageOperationService.autoUpdateExpiryDate(pageOpId);
+    try {
     // update descendants first
     // update descendants first
-    await this.renameDescendantsWithStream(page, newPagePath, user, options, false);
+      await this.renameDescendantsWithStream(page, newPagePath, user, options, false);
+    }
+    catch (err) {
+      logger.warn(err);
+      throw Error(err);
+    }
+    finally {
+      this.crowi.pageOperationService.clearAutoUpdateInterval(timerObj);
+    }
 
 
     // reduce ancestore's descendantCount
     // reduce ancestore's descendantCount
     const nToReduce = -1 * ((page.isEmpty ? 0 : 1) + page.descendantCount);
     const nToReduce = -1 * ((page.isEmpty ? 0 : 1) + page.descendantCount);