From 22f0e5198ec76adab000b404cd038983c8170aac Mon Sep 17 00:00:00 2001 From: Ewan Sheldon Date: Mon, 25 Sep 2023 12:34:29 +0200 Subject: [PATCH] stop racing --- src/transactions.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/transactions.js b/src/transactions.js index 12e9904..445315c 100644 --- a/src/transactions.js +++ b/src/transactions.js @@ -33,11 +33,7 @@ const tenSecTimeout = _ => { const retryableWithTimeout = async promise => { try { - const start = Math.floor(new Date() / 1000); - const data = await Promise.race([promise, tenSecTimeout()]); - const end = Math.floor(new Date() / 1000); - console.log(`data fetched (${end - start}s)`); - return data; + return await promise; } catch (e) { console.log(e) return await retryableWithTimeout(promise);