mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 02:20:50 +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) {
|
||||
let lasterr;
|
||||
let loopguard = window && window.loopguard; // Optional global parameter, will cancel any loops if changes
|
||||
while (count-- && (loopguard === (window && window.loopguard)) ) {
|
||||
let loopguard = (typeof window != "undefined") && window.loopguard; // Optional global parameter, will cancel any loops if changes
|
||||
while (count-- && (loopguard === ((typeof window != "undefined") && window.loopguard)) ) {
|
||||
try {
|
||||
return await fetch(req);
|
||||
} catch(err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user