@type-cacheable/redis-adapter
Advanced tools
Comparing version 14.0.1 to 14.0.2
@@ -29,22 +29,2 @@ "use strict"; | ||
class RedisAdapter { | ||
constructor(redisClient) { | ||
this.connectPromise = null; | ||
this.hasConnected = false; | ||
this.redisClient = redisClient; | ||
this.get = this.get.bind(this); | ||
this.del = this.del.bind(this); | ||
this.delHash = this.delHash.bind(this); | ||
this.getClientTTL = this.getClientTTL.bind(this); | ||
this.keys = this.keys.bind(this); | ||
this.set = this.set.bind(this); | ||
this.ensureConnection = this.ensureConnection.bind(this); | ||
this.ensureConnection().then(() => __awaiter(this, void 0, void 0, function* () { | ||
const infoString = yield this.redisClient.info().catch(); | ||
const versionFragment = infoString | ||
.split('\n') | ||
.find((info) => info.includes(REDIS_VERSION_FRAGMENT_IDENTIFIER)); | ||
this.redisVersion = | ||
(versionFragment === null || versionFragment === void 0 ? void 0 : versionFragment.replace('\r', '').split(REDIS_VERSION_FRAGMENT_IDENTIFIER)[1]) || '0'; | ||
})).catch(); | ||
} | ||
ensureConnection() { | ||
@@ -83,2 +63,22 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
constructor(redisClient) { | ||
this.connectPromise = null; | ||
this.hasConnected = false; | ||
this.redisClient = redisClient; | ||
this.get = this.get.bind(this); | ||
this.del = this.del.bind(this); | ||
this.delHash = this.delHash.bind(this); | ||
this.getClientTTL = this.getClientTTL.bind(this); | ||
this.keys = this.keys.bind(this); | ||
this.set = this.set.bind(this); | ||
this.ensureConnection = this.ensureConnection.bind(this); | ||
this.ensureConnection().then(() => __awaiter(this, void 0, void 0, function* () { | ||
const infoString = yield this.redisClient.info().catch(); | ||
const versionFragment = infoString | ||
.split('\n') | ||
.find((info) => info.includes(REDIS_VERSION_FRAGMENT_IDENTIFIER)); | ||
this.redisVersion = | ||
(versionFragment === null || versionFragment === void 0 ? void 0 : versionFragment.replace('\r', '').split(REDIS_VERSION_FRAGMENT_IDENTIFIER)[1]) || '0'; | ||
})).catch(); | ||
} | ||
// Redis doesn't have a standard TTL, it's at a per-key basis | ||
@@ -85,0 +85,0 @@ getClientTTL() { |
{ | ||
"name": "@type-cacheable/redis-adapter", | ||
"version": "14.0.1", | ||
"version": "14.0.2", | ||
"description": "Adapter for using redis with type-cacheable", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@type-cacheable/core": "^11.0.0", | ||
"@type-cacheable/core": "^11.0.1", | ||
"@types/redis": "^4.0.11", | ||
@@ -51,3 +51,3 @@ "redis": "^4.5.0", | ||
}, | ||
"gitHead": "ba374530da264bef419e893c8fa44ee2479c7782" | ||
"gitHead": "e519569d52d4809bac186afee297845c726040eb" | ||
} |
Sorry, the diff of this file is not supported yet
21157
6