*remove error
This commit is contained in:
parent
909e8be59e
commit
3ca8fd9711
|
@ -28,7 +28,7 @@ let dht: DHT;
|
||||||
addHandler("presentSeed", handlePresentSeed);
|
addHandler("presentSeed", handlePresentSeed);
|
||||||
addHandler("refreshGatewayList", handleRefreshGatewayList);
|
addHandler("refreshGatewayList", handleRefreshGatewayList);
|
||||||
addHandler("statIpfs", handleStatIpfs);
|
addHandler("statIpfs", handleStatIpfs);
|
||||||
addHandler("fetchIpfs", handleFetchIpfs, { se });
|
addHandler("fetchIpfs", handleFetchIpfs);
|
||||||
addHandler("statIpns", handleStatIpns);
|
addHandler("statIpns", handleStatIpns);
|
||||||
addHandler("fetchIpns", handleFetchIpns);
|
addHandler("fetchIpns", handleFetchIpns);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ async function handleFetchIpfs(aq: ActiveQuery) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleStatIpns(aq: ActiveQuery) {
|
async function handleStatIpns(aq: ActiveQuery) {
|
||||||
return handleStat(aq, "stat_ipns", "ipfs");
|
return handleStat(aq, "stat_ipns", "ipns");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleFetchIpns(aq: ActiveQuery) {
|
async function handleFetchIpns(aq: ActiveQuery) {
|
||||||
|
@ -196,7 +196,9 @@ async function rpcCall(
|
||||||
let timer: NodeJS.Timeout;
|
let timer: NodeJS.Timeout;
|
||||||
let dataCount = 0;
|
let dataCount = 0;
|
||||||
socket.on("data", (res) => {
|
socket.on("data", (res) => {
|
||||||
|
if (timer && timer.close) {
|
||||||
clearTimeout(timer as number);
|
clearTimeout(timer as number);
|
||||||
|
}
|
||||||
dataCount++;
|
dataCount++;
|
||||||
const response = unpack(res);
|
const response = unpack(res);
|
||||||
if (!response || response.error || (response && response?.data?.error)) {
|
if (!response || response.error || (response && response?.data?.error)) {
|
||||||
|
@ -229,7 +231,7 @@ async function rpcCall(
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
socket.end();
|
socket.end();
|
||||||
reject("timeout");
|
reject("timeout");
|
||||||
}, 5 * 1000) as NodeJS.Timeout;
|
}, 10 * 1000) as NodeJS.Timeout;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue