Skip to content

Commit

Permalink
fix redis import
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Oct 26, 2021
1 parent 6db1fb5 commit 0016d60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/cache-engines/redis.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import log from '../../logging.js';
import CONFIG from '../../config.js';

var client;

if (CONFIG.REDIS_MODE === 'cluster') {
var pkg = await import('redis-clustr');
client = new pkg.RedisClustr(CONFIG.REDIS_CLUSTER_OPTIONS);
const pkg = await import('redis-clustr');
const RedisClustr = pkg.default;
client = new RedisClustr(CONFIG.REDIS_CLUSTER_OPTIONS);
} else {
var pkg = await import('redis');
client = pkg.redis.createClient(CONFIG.REDIS_OPTIONS);
client = pkg.createClient(CONFIG.REDIS_OPTIONS);
}

export function set(key, data, options) {
Expand Down

0 comments on commit 0016d60

Please sign in to comment.