Added redis cache for on whatsapp & TTL on .env

This commit is contained in:
Judson Cairo
2024-08-28 12:11:32 -03:00
parent ce6438b9a8
commit 7a76600cd6
4 changed files with 80 additions and 13 deletions

View File

@@ -35,11 +35,11 @@ export class CacheService {
}
}
async set(key: string, value: any) {
async set(key: string, value: any, ttl?: number) {
if (!this.cache) {
return;
}
this.cache.set(key, value);
this.cache.set(key, value, ttl);
}
public async hSet(key: string, field: string, value: any) {