diff --git a/src/modules/blacklist/blacklist.service.ts b/src/modules/blacklist/blacklist.service.ts index 9e6eade..bb0aae0 100644 --- a/src/modules/blacklist/blacklist.service.ts +++ b/src/modules/blacklist/blacklist.service.ts @@ -32,7 +32,7 @@ export class BlacklistService { } const allRecords = await this.blacklistReportModel.findAll({ raw: true }); if (allRecords.length > 0) { - await this.cacheManager.set(cacheKey, allRecords, 60 * 1000); + await this.cacheManager.set(cacheKey, allRecords); const check = await this.cacheManager.get(cacheKey); console.log('Данные в кэше:', check); } @@ -67,7 +67,7 @@ export class BlacklistService { where: { steam_link: link }, }); if (allRecords.length > 0) { - await this.cacheManager.set(cacheKey, allRecords, 60 * 1000); + await this.cacheManager.set(cacheKey, allRecords); const check = await this.cacheManager.get(cacheKey); console.log('Данные в кэше:', check); } @@ -150,6 +150,8 @@ export class BlacklistService { async createBlacklistRecord( blackListReportDto: BlacklistReportDto, ): Promise { + const cacheKey = 'hunt-blacklist:all'; + await this.cacheManager.del(cacheKey); const report = BlacklistReport.build(blackListReportDto); return await report.save(); }