From bcf4b0d998bea149a2b40017131a18d66bd54cd3 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 31 Aug 2022 18:25:55 -0400 Subject: [PATCH] *set relayTimeout to 30 seconds --- src/index.ts | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index c01f2f1..41acee4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -150,15 +150,28 @@ async function fetchFromRelays( for (const relay of activeRelays) { let query; if (stream) { - query = network.streamingQuery(relay, method, "ipfs", stream, { - hash, - path, - }); + query = network.streamingQuery( + relay, + method, + "ipfs", + stream, + { + hash, + path, + }, + { relayTimeout: 30 } + ); } else { - query = network.simpleQuery(relay, method, "ipfs", { - hash, - path, - }); + query = network.simpleQuery( + relay, + method, + "ipfs", + { + hash, + path, + }, + { relayTimeout: 30 } + ); } let resp = await query.result; if (resp.error) {