*Only close socket when stream is done
This commit is contained in:
parent
c750fce402
commit
ac8b1d4bf2
|
@ -46,7 +46,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
|
||||||
if (timer && timer.close) {
|
if (timer && timer.close) {
|
||||||
clearTimeout(timer as any);
|
clearTimeout(timer as any);
|
||||||
}
|
}
|
||||||
socket.end();
|
|
||||||
const response = unpack(res as any) as RPCResponse;
|
const response = unpack(res as any) as RPCResponse;
|
||||||
if (response && response.error) {
|
if (response && response.error) {
|
||||||
this._errors[relay] = response.error;
|
this._errors[relay] = response.error;
|
||||||
|
@ -56,6 +55,7 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
|
||||||
if (response?.data.done) {
|
if (response?.data.done) {
|
||||||
this._responses[relay] = {};
|
this._responses[relay] = {};
|
||||||
resolve(null);
|
resolve(null);
|
||||||
|
socket.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue