@@ -10,16 +10,16 @@ type XpResponseProps = Record<string, any>;
10
10
11
11
const clientOptions : RedisClientOptions = {
12
12
url : process . env . REDIS_URI_PAGECACHE ,
13
- username : process . env . REDIS_USERNAME_PAGECACHE ,
14
- password : process . env . REDIS_PASSWORD_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 ;
@@ -37,21 +37,23 @@ class RedisCacheImpl {
37
37
private renderCacheKeyPrefix = '' ;
38
38
39
39
constructor ( ) {
40
+ logger . info ( clientOptions . url ) ;
41
+ logger . info ( clientOptions . username ) ;
40
42
this . client = createClient ( clientOptions )
41
43
. on ( 'connect' , ( ) => {
42
- logger . info ( 'Redis client connected' ) ;
44
+ logger . info ( 'Valkey client connected' ) ;
43
45
} )
44
46
. on ( 'ready' , ( ) => {
45
- logger . info ( 'Redis client ready' ) ;
47
+ logger . info ( 'Valkey client ready' ) ;
46
48
} )
47
49
. on ( 'end' , ( ) => {
48
- logger . info ( 'Redis client connection closed' ) ;
50
+ logger . info ( 'Valkey client connection closed' ) ;
49
51
} )
50
52
. on ( 'reconnecting' , ( ) => {
51
- logger . info ( 'Redis client reconnecting' ) ;
53
+ logger . info ( 'Valkey client reconnecting' ) ;
52
54
} )
53
55
. on ( 'error' , ( err ) => {
54
- logger . error ( `Redis client error: ${ err } ` ) ;
56
+ logger . error ( `Valkey client error: ${ err } ` ) ;
55
57
} ) ;
56
58
}
57
59
@@ -61,7 +63,7 @@ class RedisCacheImpl {
61
63
62
64
return this . client . connect ( ) . then ( ( ) => {
63
65
logger . info (
64
- `Initialized redis client with url ${ clientOptions . url } - Render key prefix: ${ this . renderCacheKeyPrefix } - Response key prefix: ${ this . responseCacheKeyPrefix } `
66
+ `Initialized valkey client with url ${ clientOptions . url } - Render key prefix: ${ this . renderCacheKeyPrefix } - Response key prefix: ${ this . responseCacheKeyPrefix } `
65
67
) ;
66
68
return this ;
67
69
} ) ;
0 commit comments