Răsfoiți Sursa

Renamed config key

Taichi Masuyama 4 ani în urmă
părinte
comite
92ee5554d9

+ 2 - 2
packages/app/src/server/service/config-loader.ts

@@ -172,9 +172,9 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    ValueType.BOOLEAN,
     default: false,
   },
-  V5_PATH_INDEX_STATUS: {
+  V5_INDEX_NORMALIZATION_STATUS: {
     ns:      'crowi',
-    key:     'app:v5PathIndexStatus',
+    key:     'app:v5IndexNormalizationStatus',
     type:    ValueType.STRING,
     default: 'processable',
   },

+ 7 - 7
packages/app/src/server/service/page.js

@@ -865,14 +865,14 @@ class PageService {
     }
   }
 
-  async _setV5PathIndexStatus(status) {
+  async _setV5IndexNormalizationStatus(status) {
     try {
       await this.crowi.configManager.updateConfigsInTheSameNamespace('crowi', {
-        'app:v5PathIndexStatus': status,
+        'app:v5IndexNormalizationStatus': status,
       });
     }
     catch (err) {
-      logger.error(`Failed to update app:v5PathIndexStatus to ${status} .`);
+      logger.error(`Failed to update app:v5IndexNormalizationStatus to ${status} .`);
       throw err;
     }
   }
@@ -908,7 +908,7 @@ class PageService {
 
   async v5InitialMigration(grant) {
     // const socket = this.crowi.socketIoService.getAdminSocket();
-    const status = this.crowi.configManager.getConfig('crowi', 'app:v5PathIndexStatus');
+    const status = this.crowi.configManager.getConfig('crowi', 'app:v5IndexNormalizationStatus');
 
     // avoid re-running many times
     const isProcessing = status === 'processing';
@@ -921,15 +921,15 @@ class PageService {
 
     // drop unique index first
     if (isUnique && isProcessable) {
-      await this._setV5PathIndexStatus('processing');
+      await this._setV5IndexNormalizationStatus('processing');
       try {
         await this._v5NormalizeIndex();
-        await this._setV5PathIndexStatus('processable');
+        await this._setV5IndexNormalizationStatus('processable');
       }
       catch (err) {
         logger.error('V5 index normalization failed.', err);
         // socket.emit('v5IndexNormalizationFailed', { error: err.message });
-        await this._setV5PathIndexStatus('processable');
+        await this._setV5IndexNormalizationStatus('processable');
         throw err;
       }
     }