*Change how we check/clear the timer

This commit is contained in:
Derrick Hammer 2022-09-09 22:04:55 -04:00
parent 9a04c82a5b
commit 62ef56b554
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -103,8 +103,9 @@ export default abstract class RpcQueryBase {
let timer: any; let timer: any;
socket.on("data", (res: Buffer) => { socket.on("data", (res: Buffer) => {
relay = relay as string; relay = relay as string;
if (timer && timer.close) { if (timer) {
clearTimeout(timer as any); clearTimeout(timer as any);
timer = null;
} }
socket.end(); socket.end();
const response = unpack(res as any) as RPCResponse; const response = unpack(res as any) as RPCResponse;