diff --git a/index.js b/index.js index e3efdcc..8ff9064 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,13 @@ class RedisCacheStrategy { if (configuration == null) { configuration = new ConfigurationBase(); } + // backward compatibility + if (configuration.hasStrategy(function DataCacheStrategy() {})) { + const thisService = this; + configuration.useStrategy(function DataCacheStrategy() {}, function() { + return thisService; + }); + } /** * get redis configuration * @type {{options:*=,pool:*=, absolute_expiration: number=}} diff --git a/package-lock.json b/package-lock.json index 67847d2..9cc99c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@themost/redis", - "version": "5.3.0", + "version": "5.3.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 877f266..7b8789d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@themost/redis", - "version": "5.3.0", + "version": "5.3.1", "description": "Most Web Framework Redis Cache Module", "main": "index.js", "types": "index.d.ts",