avoid hanging up on websocket apps after initial set of commands have completed

This commit is contained in:
Dave Horton
2023-01-10 08:22:53 -05:00
parent 6753fdc2b4
commit c3627cecb8

View File

@@ -667,7 +667,7 @@ class CallSession extends Emitter {
} }
} }
if (0 === this.tasks.length && this.hasStableDialog && this.requestor instanceof WsRequestor) { if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) {
let span; let span;
try { try {
const {span} = this.rootSpan.startChildSpan('waiting for commands'); const {span} = this.rootSpan.startChildSpan('waiting for commands');
@@ -678,7 +678,7 @@ class CallSession extends Emitter {
'async.request.command': command 'async.request.command': command
}); });
span.end(); span.end();
if (!this.hasStableDialog || this.callGone) break; if (this.callGone) break;
} catch (err) { } catch (err) {
span.end(); span.end();
this.logger.info(err, 'CallSession:exec - error waiting for new commands'); this.logger.info(err, 'CallSession:exec - error waiting for new commands');