Skip to content

Commit 538f6d0

Browse files
committed
fix: Various cleanup errors
Fixes #525
1 parent ec0b851 commit 538f6d0

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/cubejs-query-orchestrator/orchestrator/QueryOrchestrator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ class QueryOrchestrator {
9090
}
9191

9292
async cleanup() {
93-
await this.redisPool.cleanup();
93+
if (this.redisPool) {
94+
await this.redisPool.cleanup();
95+
}
9496
}
9597
}
9698

packages/cubejs-server-core/core/OrchestratorApi.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class OrchestratorApi {
8989
release() {
9090
return Promise.all([
9191
this.releaseDriver(this.driverFactory),
92-
this.releaseDriver(this.externalDriverFactory)
92+
this.releaseDriver(this.externalDriverFactory),
93+
this.orchestrator.cleanup()
9394
]);
9495
}
9596

packages/cubejs-server-core/core/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class CubejsServerCore {
422422
}
423423
return driverPromise;
424424
},
425-
getExternalDriverFactory: async () => {
425+
getExternalDriverFactory: this.externalDriverFactory && (async () => {
426426
if (!externalPreAggregationsDriverPromise) {
427427
const driver = await this.externalDriverFactory(context);
428428
externalPreAggregationsDriverPromise = driver.testConnection().then(() => driver).catch(e => {
@@ -431,7 +431,7 @@ class CubejsServerCore {
431431
});
432432
}
433433
return externalPreAggregationsDriverPromise;
434-
},
434+
}),
435435
redisPrefix: dataSourceId,
436436
orchestratorOptions: this.orchestratorOptions(context)
437437
});

0 commit comments

Comments
 (0)