Skip to content

Commit

Permalink
fix: TypeError: Cannot read property 'queryKey' of null under load
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Feb 24, 2020
1 parent f538135 commit 0c996d8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/cubejs-query-orchestrator/orchestrator/QueryQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ class QueryQueue {
const queryDef = await redisClient.getQueryDef(queryKey);
const [active, toProcess] = await redisClient.getQueryStageState(true);

this.logger('Waiting for query', {
queueSize,
queryKey: queryDef.queryKey,
queuePrefix: this.redisQueuePrefix,
requestId: options.requestId,
active: active.indexOf(redisClient.redisHash(queryKey)) !== -1,
queueIndex: toProcess.indexOf(redisClient.redisHash(queryKey)),
waitingForRequestId: queryDef.requestId
});
if (queryDef) {
this.logger('Waiting for query', {
queueSize,
queryKey: queryDef.queryKey,
queuePrefix: this.redisQueuePrefix,
requestId: options.requestId,
active: active.indexOf(redisClient.redisHash(queryKey)) !== -1,
queueIndex: toProcess.indexOf(redisClient.redisHash(queryKey)),
waitingForRequestId: queryDef.requestId
});
}

result = await redisClient.getResultBlocking(queryKey);
if (!result) {
Expand Down

0 comments on commit 0c996d8

Please sign in to comment.