File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface ICache {
70
70
/**
71
71
* 캐시 서버와 연결을 끊습니다.
72
72
*/
73
- disconnect ( ) : Promise < void > ;
73
+ destroy ( ) : Promise < void > ;
74
74
75
75
/**
76
76
* 캐시 서버와 연결되어 있는지 확인합니다.
Original file line number Diff line number Diff line change @@ -71,15 +71,15 @@ export class RedisCache implements ICache {
71
71
}
72
72
}
73
73
74
- async disconnect ( ) : Promise < void > {
74
+ async destroy ( ) : Promise < void > {
75
75
try {
76
76
if ( this . connected ) {
77
- await this . client . disconnect ( ) ;
77
+ this . client . destroy ( ) ;
78
78
this . connected = false ;
79
79
logger . info ( 'Redis cache connection closed' ) ;
80
80
}
81
81
} catch ( error ) {
82
- logger . error ( 'Failed to disconnect from Redis cache:' , error ) ;
82
+ logger . error ( 'Failed to destroy from Redis cache:' , error ) ;
83
83
throw error ;
84
84
}
85
85
}
@@ -153,6 +153,7 @@ export class RedisCache implements ICache {
153
153
async exists ( key : string ) : Promise < boolean > {
154
154
try {
155
155
if ( ! this . connected ) {
156
+ logger . warn ( 'Redis not connected, skipping cache exists' ) ;
156
157
return false ;
157
158
}
158
159
@@ -206,6 +207,7 @@ export class RedisCache implements ICache {
206
207
async size ( ) : Promise < number > {
207
208
try {
208
209
if ( ! this . connected ) {
210
+ logger . warn ( 'Redis not connected, skipping cache size, return 0' ) ;
209
211
return 0 ;
210
212
}
211
213
You can’t perform that action at this time.
0 commit comments