mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 18:30:49 +00:00
Fix problem with loopfetch under node
This commit is contained in:
parent
478f738024
commit
935de30f8d
@ -23,8 +23,8 @@ httptools = {};
|
|||||||
|
|
||||||
async function loopfetch(req, ms, count, what) {
|
async function loopfetch(req, ms, count, what) {
|
||||||
let lasterr;
|
let lasterr;
|
||||||
let loopguard = window && window.loopguard; // Optional global parameter, will cancel any loops if changes
|
let loopguard = (typeof window != "undefined") && window.loopguard; // Optional global parameter, will cancel any loops if changes
|
||||||
while (count-- && (loopguard === (window && window.loopguard)) ) {
|
while (count-- && (loopguard === ((typeof window != "undefined") && window.loopguard)) ) {
|
||||||
try {
|
try {
|
||||||
return await fetch(req);
|
return await fetch(req);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user