From e84e48cc060b1f2adc81331ef7e08d425257def7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Moreau?= <cem.moreau@gmail.com>
Date: Sun, 4 Feb 2018 17:47:01 +0100
Subject: [PATCH] [fix] Transpilation no more passes

---
 app/lib/dal/sqliteDAL/MetaDAL.ts | 4 ++--
 app/modules/crawler/lib/sync.ts  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/lib/dal/sqliteDAL/MetaDAL.ts b/app/lib/dal/sqliteDAL/MetaDAL.ts
index 158d39f4d..4cb8299eb 100644
--- a/app/lib/dal/sqliteDAL/MetaDAL.ts
+++ b/app/lib/dal/sqliteDAL/MetaDAL.ts
@@ -407,14 +407,14 @@ export class MetaDAL extends AbstractSQLite<DBMeta> {
       'COMMIT;')
   }
 
-  private async executeMigration(migration: any[], conf:ConfDTO) {
+  private async executeMigration(migration: (string|((conf:ConfDTO)=>void)), conf:ConfDTO) {
     try {
       if (typeof migration == "string") {
 
         // Simple SQL script to pass
         await this.exec(migration);
 
-      } else if (typeof migration == "function") {
+      } else {
 
         // JS function to execute
         await migration(conf);
diff --git a/app/modules/crawler/lib/sync.ts b/app/modules/crawler/lib/sync.ts
index e5f39d8a7..df6f29031 100644
--- a/app/modules/crawler/lib/sync.ts
+++ b/app/modules/crawler/lib/sync.ts
@@ -759,7 +759,7 @@ class P2PDownloader {
       // Continue
       return chosens;
     }, []);
-    let candidates = await Promise.all(promises)
+    let candidates:any[] = await Promise.all(promises)
     candidates.forEach((c:any) => {
       c.tta = c.tta || 0; // By default we say a node is super slow to answer
       c.ttas = c.ttas || []; // Memorize the answer delays
-- 
GitLab