@mondart/nestjs-common-module 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,6 @@ export declare class CachingService {
|
|
|
4
4
|
constructor(cacheManager: Cache);
|
|
5
5
|
getRedisClient(): import("keyv").Keyv<any>[];
|
|
6
6
|
get<T>(key: string): Promise<T | undefined>;
|
|
7
|
-
set<T>(key: string, value: T, ttlSeconds
|
|
7
|
+
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
8
8
|
del(key: string): Promise<void>;
|
|
9
9
|
}
|
|
@@ -30,7 +30,7 @@ let CachingService = class CachingService {
|
|
|
30
30
|
return undefined;
|
|
31
31
|
}
|
|
32
32
|
async set(key, value, ttlSeconds) {
|
|
33
|
-
await this.cacheManager.set(key, JSON.stringify(value), ttlSeconds * 1000);
|
|
33
|
+
await this.cacheManager.set(key, JSON.stringify(value), ttlSeconds ? ttlSeconds * 1000 : undefined);
|
|
34
34
|
}
|
|
35
35
|
async del(key) {
|
|
36
36
|
await this.cacheManager.del(key);
|