@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
- return JSON.parse(gotValue);
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;
@@ -65,7 +65,11 @@ export class CacheService {
65
65
  const gotValue = await x.redis.get(redisKey);
66
66
  if (gotValue) {
67
67
  try {
68
- return JSON.parse(gotValue);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",