From 0203bb96e0ad8318563f0e4da599a0e8e6e9c5df Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Fri, 24 Apr 2020 20:09:06 +0200
Subject: [PATCH] [fix] sync: save wot file on sync

---
 app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts b/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts
index df7aa5b1d..b4c222601 100644
--- a/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts
+++ b/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts
@@ -149,7 +149,14 @@ export class GlobalIndexStream extends Duplex {
         return callback(null);
       }
 
+      // Index blocks chunk
       await this.transform(dataArray);
+
+      // Save wot file
+      if (!this.memoryOnly) {
+        this.wotbMem.writeInFile(this.wotbFilePath);
+      }
+
       this.watcher.appliedPercent(
         Math.round(
           (dataArray[0].block.number /
-- 
GitLab