File tree 2 files changed +18
-8
lines changed
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,20 @@ export default class PageCacheHandler {
25
25
return fromLocalCache ;
26
26
}
27
27
28
- const fromRedisCache = await redisCache . getRender ( key ) ;
29
- logger . info (
30
- `PageCache: content ${ key } in fromRedisCache: ${ fromRedisCache ? 'found' : 'not found' } : ${ JSON . stringify ( fromRedisCache ) } `
31
- ) ;
32
- if ( ! fromRedisCache ) {
28
+ try {
29
+ const fromRedisCache = await redisCache . getRender ( key ) ;
30
+ logger . info (
31
+ `PageCache: content ${ key } in fromRedisCache: ${ fromRedisCache ? 'found' : 'not found' } : ${ JSON . stringify ( fromRedisCache ) } `
32
+ ) ;
33
+ if ( ! fromRedisCache ) {
34
+ return null ;
35
+ }
36
+
37
+ return fromRedisCache ;
38
+ } catch ( error ) {
39
+ logger . error ( `PageCache: error getting fromRedisCache: ${ error } ` ) ;
33
40
return null ;
34
41
}
35
-
36
- return fromRedisCache ;
37
42
}
38
43
39
44
public async set ( ...args : Parameters < FileSystemCache [ 'set' ] > ) {
Original file line number Diff line number Diff line change @@ -86,7 +86,12 @@ class RedisCacheImpl {
86
86
. getEx ( fullKey , {
87
87
PX : this . renderCacheTTL ,
88
88
} )
89
- . then ( ( result ) => ( result ? JSON . parse ( result ) : result ) )
89
+ . then ( ( result ) => {
90
+ logger . info (
91
+ `RedisCache: getRender parsing result: ${ result ? JSON . parse ( result ) : result } `
92
+ ) ;
93
+ return result ? JSON . parse ( result ) : result ;
94
+ } )
90
95
. catch ( ( e ) => {
91
96
logger . error ( `Error getting render cache value for key ${ fullKey } - ${ e } ` ) ;
92
97
return Promise . resolve ( null ) ;
You can’t perform that action at this time.
0 commit comments