瀏覽代碼

batch size interval Variable Refactoring

Yuken Tezuka 3 年之前
父節點
當前提交
ef8d2f46b4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      bin/data-migrations/v6/migration.js

+ 2 - 2
bin/data-migrations/v6/migration.js

@@ -83,7 +83,7 @@ switch (migrationType) {
 }
 
 var batchSize = process.env.BATCH_SIZE ?? 100; // default 100 revisions in 1 bulkwrite
-var sleepTime = process.env.SLEEP_TIME ?? 5; // default 5 milliseconds
+var batchSizeInterval = process.env.BATCH_INTERVAL ?? 3000; // default 3 sec
 
 pagesCollection.find({}).forEach((doc) => {
   if (doc.revision) {
@@ -103,7 +103,7 @@ pagesCollection.find({}).forEach((doc) => {
     if (operations.length > (batchSize - 1)) {
       revisionsCollection.bulkWrite(operations);
       // sleep time can be set from env var
-      sleep(sleepTime);
+      sleep(batchSizeInterval);
       operations = [];
     }
   }