@midwayjs/cache-manager
Advanced tools
Comparing version 3.15.2 to 3.15.5
@@ -31,5 +31,6 @@ "use strict"; | ||
around: async (joinPoint) => { | ||
let cacheKey = metadata.cacheKey; | ||
const cachingInstance = this.cacheService.get(metadata.cacheInstanceName); | ||
if (typeof metadata.cacheKey === 'function') { | ||
metadata.cacheKey = await metadata.cacheKey({ | ||
if (typeof cacheKey === 'function') { | ||
cacheKey = await cacheKey({ | ||
methodArgs: joinPoint.args, | ||
@@ -40,4 +41,4 @@ ctx: joinPoint.target[core_1.REQUEST_OBJ_CTX_KEY], | ||
} | ||
if (typeof metadata.cacheKey === 'string') { | ||
return cachingInstance.methodWrap(metadata.cacheKey, joinPoint.proceed, joinPoint.args, metadata.ttl); | ||
if (typeof cacheKey === 'string') { | ||
return cachingInstance.methodWrap(cacheKey, joinPoint.proceed, joinPoint.args, metadata.ttl); | ||
} | ||
@@ -44,0 +45,0 @@ else { |
{ | ||
"name": "@midwayjs/cache-manager", | ||
"version": "3.15.2", | ||
"version": "3.15.5", | ||
"description": "midway cache manager", | ||
@@ -40,3 +40,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "e8b53689c50aa8c9a691de7d985cafd62f5f70e7" | ||
"gitHead": "dd49d3241aebba3b34f81ed488b4ec76244843c9" | ||
} |
36475
798