File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ export class RedisCache implements ICache {
55
55
return this ;
56
56
}
57
57
58
+ /**
59
+ * It enables or disables the cache.
60
+ * @param {boolean } enable - boolean
61
+ * @returns RedisCache.
62
+ */
58
63
public enable ( enable : boolean ) : RedisCache {
59
64
this . _enable = enable ;
60
65
return this ;
@@ -212,6 +217,13 @@ export class RedisCache implements ICache {
212
217
}
213
218
}
214
219
220
+ /**
221
+ * It sets a value in the cache.
222
+ * @param {string } key - The key to set.
223
+ * @param {any } value - The value to be stored in the cache.
224
+ * @param {number } ttl - The time-to-live in milliseconds for the key.
225
+ * @returns A promise.
226
+ */
215
227
async put ( key : string , value : any , ttl : number = this . _ttl ) : Promise < boolean > {
216
228
try {
217
229
await this . destroy ( key ) ;
@@ -224,7 +236,7 @@ export class RedisCache implements ICache {
224
236
/**
225
237
* For each tag, if the key is not a member of the tag, add the key to the tag.
226
238
* @param {string } key - The key to add to the set.
227
- * @returns Nothing .
239
+ * @returns A Promise .
228
240
*/
229
241
private async _addTags ( key : string ) {
230
242
const tagPromises = this . _tags
You can’t perform that action at this time.
0 commit comments