From c841b45013a494ebe9ee8a4454fbab61ac9e4bc7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 9 Sep 2022 22:25:58 -0400 Subject: [PATCH] *Update dist --- dist/query/simple.d.ts.map | 2 +- dist/query/simple.js | 1 - dist/query/streaming.d.ts.map | 2 +- dist/query/streaming.js | 12 +++--------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/dist/query/simple.d.ts.map b/dist/query/simple.d.ts.map index c1385d9..472d96f 100644 --- a/dist/query/simple.d.ts.map +++ b/dist/query/simple.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/query/simple.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,WAAW,CAAC;AACrC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,OAAO,CAAC,MAAM,CAAkB;gBAE9B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,eAAe;IAM1B,SAAS,CAAC,cAAc,IAAI,IAAI;IAahC,SAAS,CAAC,SAAS,IAAI,MAAM,EAAE,GAAG,MAAM,EAAE;CAG3C"} \ No newline at end of file +{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/query/simple.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,WAAW,CAAC;AACrC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,OAAO,CAAC,MAAM,CAAkB;gBAE9B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,eAAe;IAM1B,SAAS,CAAC,cAAc,IAAI,IAAI;IAYhC,SAAS,CAAC,SAAS,IAAI,MAAM,EAAE,GAAG,MAAM,EAAE;CAG3C"} \ No newline at end of file diff --git a/dist/query/simple.js b/dist/query/simple.js index f4713df..5d33dbd 100644 --- a/dist/query/simple.js +++ b/dist/query/simple.js @@ -13,7 +13,6 @@ export default class SimpleRpcQuery extends RpcQueryBase { if (Object.keys(this._errors).length) { const error = Object.values(this._errors).pop(); this.resolve(error, error === "timeout"); - return; } } getRelays() { diff --git a/dist/query/streaming.d.ts.map b/dist/query/streaming.d.ts.map index a82ee65..6ba47c2 100644 --- a/dist/query/streaming.d.ts.map +++ b/dist/query/streaming.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/query/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,sBAAsB,CAAC;AACpE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,SAAS,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC7C,SAAS,CAAC,SAAS,UAAS;gBAE1B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,wBAAwB;IAM5B,MAAM;cAIG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CA0EjE"} \ No newline at end of file +{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/query/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,sBAAsB,CAAC;AACpE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,SAAS,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC7C,SAAS,CAAC,SAAS,UAAS;gBAE1B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,wBAAwB;IAM5B,MAAM;cAIG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAmEjE"} \ No newline at end of file diff --git a/dist/query/streaming.js b/dist/query/streaming.js index fc3670d..6a15518 100644 --- a/dist/query/streaming.js +++ b/dist/query/streaming.js @@ -1,7 +1,7 @@ import SimpleRpcQuery from "./simple.js"; import { Buffer } from "buffer"; import { isPromise } from "../util.js"; -import { clearTimeout, setTimeout } from "timers"; +import { clearTimeout } from "timers"; import { pack, unpack } from "msgpackr"; export default class StreamingRpcQuery extends SimpleRpcQuery { _options; @@ -33,7 +33,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery { return; } return new Promise((resolve, reject) => { - let timer; const finish = () => { relay = relay; this._responses[relay] = {}; @@ -42,10 +41,9 @@ export default class StreamingRpcQuery extends SimpleRpcQuery { }; const listener = (res) => { relay = relay; - if (timer) { - clearTimeout(timer); - timer = null; + if (this._timeoutTimer) { clearTimeout(this._timeoutTimer); + this._timeoutTimer = null; } if (this._canceled) { socket.write(pack({ cancel: true })); @@ -72,10 +70,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery { }); socket.write("rpc"); socket.write(pack(this._query)); - timer = setTimeout(() => { - this._errors[relay] = "timeout"; - reject(null); - }, (this._options.relayTimeout || this._network.relayTimeout) * 1000); }); } }