*Use NodeJS.Timeout type
This commit is contained in:
parent
8c95ddc07b
commit
cf3853702f
|
@ -76,7 +76,7 @@ export default class RpcQuery {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let timer: number;
|
let timer: NodeJS.Timeout;
|
||||||
socket.on("data", (res: Buffer) => {
|
socket.on("data", (res: Buffer) => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
socket.end();
|
socket.end();
|
||||||
|
@ -92,7 +92,7 @@ export default class RpcQuery {
|
||||||
socket.write(pack(this._query));
|
socket.write(pack(this._query));
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
reject("timeout");
|
reject("timeout");
|
||||||
}, this._network.relayTimeout * 1000);
|
}, this._network.relayTimeout * 1000) as NodeJS.Timeout;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue