mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
verbhook on ws connection should be ended in next redirect command (#616)
* verbhook on ws connection should be ended in next redirect command * wip * wip * minor change for readability --------- Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
@@ -162,7 +162,17 @@ class Task extends Emitter {
|
||||
try {
|
||||
const json = await this.cs.requestor.request(type, this.actionHook, params, httpHeaders);
|
||||
span.setAttributes({'http.statusCode': 200});
|
||||
span.end();
|
||||
const isWsConnection = this.cs.requestor instanceof WsRequestor;
|
||||
if (!isWsConnection || (expectResponse && json && Array.isArray(json) && json.length)) {
|
||||
span.end();
|
||||
} else {
|
||||
/** we use this span to measure application response latency,
|
||||
* and with websocket connections we generally get the application's response
|
||||
* in a subsequent message from the far end, so we terminate the span when the
|
||||
* first new set of verbs arrive after sending a transcript
|
||||
* */
|
||||
this.emit('VerbHookSpanWaitForEnd', {span});
|
||||
}
|
||||
if (expectResponse && json && Array.isArray(json)) {
|
||||
const makeTask = require('./make_task');
|
||||
const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata));
|
||||
|
||||
Reference in New Issue
Block a user