@jayfong/x-server 2.17.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,7 +70,11 @@ class CacheService {
|
|
|
70
70
|
const gotValue = await _x.x.redis.get(redisKey);
|
|
71
71
|
if (gotValue) {
|
|
72
72
|
try {
|
|
73
|
-
|
|
73
|
+
const parsedValue = JSON.parse(gotValue);
|
|
74
|
+
if (this.options.memory) {
|
|
75
|
+
this.memoryCache.set(redisKey, parsedValue);
|
|
76
|
+
}
|
|
77
|
+
return parsedValue;
|
|
74
78
|
} catch {}
|
|
75
79
|
}
|
|
76
80
|
return null;
|
package/lib/services/cache.js
CHANGED
|
@@ -65,7 +65,11 @@ export class CacheService {
|
|
|
65
65
|
const gotValue = await x.redis.get(redisKey);
|
|
66
66
|
if (gotValue) {
|
|
67
67
|
try {
|
|
68
|
-
|
|
68
|
+
const parsedValue = JSON.parse(gotValue);
|
|
69
|
+
if (this.options.memory) {
|
|
70
|
+
this.memoryCache.set(redisKey, parsedValue);
|
|
71
|
+
}
|
|
72
|
+
return parsedValue;
|
|
69
73
|
} catch {}
|
|
70
74
|
}
|
|
71
75
|
return null;
|