Skip to content

Commit c7af212

Browse files
authored
chore: Show deprecation notice for Redis (#6254)
1 parent aad6aa3 commit c7af212

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

packages/cubejs-query-orchestrator/src/orchestrator/PreAggregations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class PreAggregationLoadCache {
310310

311311
public async fetchTables(preAggregation: PreAggregationDescription) {
312312
if (preAggregation.external && !this.externalDriverFactory) {
313-
throw new Error('externalDriverFactory is not provided. Please make sure @cubejs-backend/cubestore-driver is installed and use CUBEJS_DEV_MODE=true or provide Cube Store connection env variables for production usage.');
313+
throw new Error('externalDriverFactory is not provided. Please use CUBEJS_DEV_MODE=true or provide Cube Store connection env variables for production usage.');
314314
}
315315

316316
const newTables = await this.fetchTablesNoCache(preAggregation);

packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ export interface QueryOrchestratorOptions {
3030
skipExternalCacheAndQueue?: boolean;
3131
}
3232

33+
let redisDeprecationShowed = false;
34+
3335
function detectQueueAndCacheDriver(options: QueryOrchestratorOptions): CacheAndQueryDriverType {
3436
if (options.cacheAndQueueDriver) {
3537
return options.cacheAndQueueDriver;
3638
}
3739

38-
if (getEnv('cacheAndQueueDriver')) {
39-
return getEnv('cacheAndQueueDriver');
40+
const cacheAndQueueDriver = getEnv('cacheAndQueueDriver');
41+
if (cacheAndQueueDriver) {
42+
return cacheAndQueueDriver;
4043
}
4144

4245
if (getEnv('redisUrl') || getEnv('redisUseIORedis')) {
@@ -78,6 +81,16 @@ export class QueryOrchestrator {
7881
);
7982
}
8083

84+
if (cacheAndQueueDriver === 'redis' && !redisDeprecationShowed) {
85+
this.logger('Redis Deprecation', {
86+
warning: (
87+
'Redis queue and cache driver is deprecated and no longer supported. Please consider switching to cubestore option.'
88+
)
89+
});
90+
91+
redisDeprecationShowed = true;
92+
}
93+
8194
const { externalDriverFactory, continueWaitTimeout, skipExternalCacheAndQueue } = options;
8295

8396
const redisPool = cacheAndQueueDriver === 'redis' ? new RedisPool(options.redisPoolOptions) : undefined;

0 commit comments

Comments
 (0)