@@ -39,10 +39,6 @@ interface IRedisCache {
39
39
getResponse ( key : string ) : Promise < XpResponseProps | null > ;
40
40
41
41
setResponse ( key : string , data : XpResponseProps ) : Promise < string | null > ;
42
-
43
- delete ( key : string ) : Promise < number > ;
44
-
45
- clear ( ) : Promise < string > ;
46
42
}
47
43
48
44
class RedisCacheImpl implements IRedisCache {
@@ -125,29 +121,6 @@ class RedisCacheImpl implements IRedisCache {
125
121
) ;
126
122
}
127
123
128
- public async delete ( key : string ) {
129
- const responseKey = this . getFullKey ( key , this . responseCacheKeyPrefix ) ;
130
- const renderKey = this . getFullKey ( key , this . renderCacheKeyPrefix ) ;
131
-
132
- logger . info (
133
- `Deleting redis cache entries for ${ responseKey } and ${ renderKey } `
134
- ) ;
135
-
136
- return this . client . del ( [ responseKey , renderKey ] ) . catch ( ( e ) => {
137
- logger . error ( `Error deleting value for key ${ key } - ${ e } ` ) ;
138
- return 0 ;
139
- } ) ;
140
- }
141
-
142
- public async clear ( ) {
143
- logger . info ( 'Clearing redis cache!' ) ;
144
-
145
- return this . client . flushDb ( ) . catch ( ( e ) => {
146
- logger . error ( `Error flushing database - ${ e } ` ) ;
147
- return 'error' ;
148
- } ) ;
149
- }
150
-
151
124
private getFullKey ( key : string , keyPrefix : string ) {
152
125
return `${ keyPrefix } :${ pathToCacheKey ( key ) } ` ;
153
126
}
@@ -173,14 +146,6 @@ class RedisCacheDummy implements IRedisCache {
173
146
public async setResponse ( key : string , data : XpResponseProps ) {
174
147
return null ;
175
148
}
176
-
177
- public async delete ( key : string ) {
178
- return 1 ;
179
- }
180
-
181
- public async clear ( ) {
182
- return 'Ok' ;
183
- }
184
149
}
185
150
186
151
export const RedisCache =
0 commit comments