Skip to content

Commit 2937659

Browse files
committed
modify: disconn 대신 destroy, log warning 강화
1 parent a208007 commit 2937659

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/modules/cache/cache.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export interface ICache {
7070
/**
7171
* 캐시 서버와 연결을 끊습니다.
7272
*/
73-
disconnect(): Promise<void>;
73+
destroy(): Promise<void>;
7474

7575
/**
7676
* 캐시 서버와 연결되어 있는지 확인합니다.

src/modules/cache/redis.cache.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ export class RedisCache implements ICache {
7171
}
7272
}
7373

74-
async disconnect(): Promise<void> {
74+
async destroy(): Promise<void> {
7575
try {
7676
if (this.connected) {
77-
await this.client.disconnect();
77+
this.client.destroy();
7878
this.connected = false;
7979
logger.info('Redis cache connection closed');
8080
}
8181
} catch (error) {
82-
logger.error('Failed to disconnect from Redis cache:', error);
82+
logger.error('Failed to destroy from Redis cache:', error);
8383
throw error;
8484
}
8585
}
@@ -153,6 +153,7 @@ export class RedisCache implements ICache {
153153
async exists(key: string): Promise<boolean> {
154154
try {
155155
if (!this.connected) {
156+
logger.warn('Redis not connected, skipping cache exists');
156157
return false;
157158
}
158159

@@ -206,6 +207,7 @@ export class RedisCache implements ICache {
206207
async size(): Promise<number> {
207208
try {
208209
if (!this.connected) {
210+
logger.warn('Redis not connected, skipping cache size, return 0');
209211
return 0;
210212
}
211213

0 commit comments

Comments
 (0)