@ -102,9 +97,6 @@ async function getExpiriesFromNodes(
);
);
if(!Object.keys(expirationResults).length){
if(!Object.keys(expirationResults).length){
window?.log?.warn(
'WIP: [getExpiriesFromNodes] failed to parse "get_expiries" results. expirationResults is empty'
);
thrownewError('expirationResults is empty');
thrownewError('expirationResults is empty');
}
}
@ -117,17 +109,19 @@ async function getExpiriesFromNodes(
);
);
returnexpiryTimestamps;
returnexpiryTimestamps;
}catch(e){
}catch(err){
window?.log?.warn('WIP: [getExpiriesFromNodes] Failed to parse "swarm" result: ',e);
}
return[];
}catch(e){
window?.log?.warn(
window?.log?.warn(
'WIP: [getExpiriesFromNodes] - send error:',
'WIP: [getExpiriesFromNodes] - send error:',
e,
err.message||err,
`destination ${targetNode.ip}:${targetNode.port}`
`destination ${targetNode.ip}:${targetNode.port}`
);
);
throwe;
// NOTE batch requests have their own retry logic which includes abort errors that will break our retry logic so we need to catch them and throw regular errors
if(errinstanceofpRetry.AbortError){
throwError(err.message);
}
throwerr;
}
}
}
}
@ -203,26 +197,6 @@ export async function getExpiriesFromSnode(
letsnode: Snode|undefined;
letsnode: Snode|undefined;
awaitpRetry(
async()=>{
constswarm=awaitgetSwarmFor(ourPubKey);
snode=sample(swarm);
if(!snode){
thrownewEmptySwarmError(ourPubKey,'Ran out of swarm nodes to query');