@@ -9,17 +9,17 @@ import { pathToCacheKey } from 'srcCommon/cache-key';
9
9
type XpResponseProps = Record < string , any > ;
10
10
11
11
const clientOptions : RedisClientOptions = {
12
- url : process . env . REDIS_URI_PAGECACHE ,
13
- username : process . env . REDIS_USERNAME_PAGECACHE ,
14
- password : process . env . REDIS_PASSWORD_PAGECACHE ,
12
+ url : process . env . VALKEY_URI_PAGECACHE ,
13
+ username : process . env . VALKEY_USERNAME_PAGECACHE ,
14
+ password : process . env . VALKEY_PASSWORD_PAGECACHE ,
15
15
socket : { keepAlive : 5000 , connectTimeout : 10000 } ,
16
16
} as const ;
17
17
18
18
const validateClientOptions = ( ) => {
19
19
const isValid = ! ! ( clientOptions . url && clientOptions . username && clientOptions . password ) ;
20
20
21
21
if ( ! isValid ) {
22
- logger . error ( `Client options for Redis has missing parameters!` ) ;
22
+ logger . error ( `Client options for Valkey has missing parameters!` ) ;
23
23
}
24
24
25
25
return isValid ;
@@ -39,19 +39,19 @@ class RedisCacheImpl {
39
39
constructor ( ) {
40
40
this . client = createClient ( clientOptions )
41
41
. on ( 'connect' , ( ) => {
42
- logger . info ( 'Redis client connected' ) ;
42
+ logger . info ( 'Valkey client connected' ) ;
43
43
} )
44
44
. on ( 'ready' , ( ) => {
45
- logger . info ( 'Redis client ready' ) ;
45
+ logger . info ( 'Valkey client ready' ) ;
46
46
} )
47
47
. on ( 'end' , ( ) => {
48
- logger . info ( 'Redis client connection closed' ) ;
48
+ logger . info ( 'Valkey client connection closed' ) ;
49
49
} )
50
50
. on ( 'reconnecting' , ( ) => {
51
- logger . info ( 'Redis client reconnecting' ) ;
51
+ logger . info ( 'Valkey client reconnecting' ) ;
52
52
} )
53
53
. on ( 'error' , ( err ) => {
54
- logger . error ( `Redis client error: ${ err } ` ) ;
54
+ logger . error ( `Valkey client error: ${ err } ` ) ;
55
55
} ) ;
56
56
}
57
57
@@ -61,7 +61,7 @@ class RedisCacheImpl {
61
61
62
62
return this . client . connect ( ) . then ( ( ) => {
63
63
logger . info (
64
- `Initialized redis client with url ${ clientOptions . url } - Render key prefix: ${ this . renderCacheKeyPrefix } - Response key prefix: ${ this . responseCacheKeyPrefix } `
64
+ `Initialized valkey client with url ${ clientOptions . url } - Render key prefix: ${ this . renderCacheKeyPrefix } - Response key prefix: ${ this . responseCacheKeyPrefix } `
65
65
) ;
66
66
return this ;
67
67
} ) ;
0 commit comments