Skip to content

Commit

Permalink
fix(query-orchestrator): streams cluster (#6048)
Browse files Browse the repository at this point in the history
  • Loading branch information
buntarb committed Jan 23, 2023
1 parent 69143d5 commit c5b6702
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ export class QueryQueue {
let target;
switch (handler) {
case 'stream':
target = this.getQueryStream(activeKeys[0]);
target = this.getQueryStream(this.redisHash(queryKey));
await this.queryTimeout(this.queryHandlers.stream(query.query, target));
break;
default:
Expand Down Expand Up @@ -897,6 +897,11 @@ export class QueryQueue {
activated,
queryExists: !!query
});
// closing stream
if (query?.queryHandler === 'stream') {
const stream = this.getQueryStream(this.redisHash(queryKey));
stream.destroy();
}
const currentProcessingId = await queueConnection.freeProcessingLock(queryKey, processingId, activated);
if (currentProcessingId) {
this.logger('Skipping free processing lock', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class QueryStream extends stream.Transform {
this.queryKey = key;
this.maps = maps;
this.aliasNameToMember = aliasNameToMember;
if (!this.aliasNameToMember) {
this.emit('error', 'The QueryStream `aliasNameToMember` property is missed.');
}
}

/**
Expand Down

0 comments on commit c5b6702

Please sign in to comment.