Skip to content

Commit

Permalink
Modified redis configuration to increase max response count.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmoy12c committed Nov 27, 2023
1 parent 8aca3b7 commit f083df1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ import * as redisStore from 'cache-manager-redis-store';
AuthModule,
FormModule,
HealthModule,
CacheModule.register(
{
CacheModule.register({
isGlobal: true,
store: redisStore,
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
ttl: 1800, //seconds
}
),
max: 1000
}),
MonitoringModule,
],
controllers: [AppController, ServiceController],
Expand Down
4 changes: 2 additions & 2 deletions src/modules/bot/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class BotService {
const cacheKey = `bots_${ownerID}_${ownerOrgID}`;
const cachedBots = await this.cacheManager.get(cacheKey);
if (cachedBots) {
this.logger.log(`BotService::findAllContextual: Returning bot data. Time taken: ${performance.now() - startTime} milliseconds.`);
this.logger.log(`BotService::findAllContextual: Returning bot data from cache. Time taken: ${performance.now() - startTime} milliseconds.`);
return cachedBots;
}

Expand Down Expand Up @@ -351,7 +351,7 @@ export class BotService {
}
});

this.logger.log(`BotService::findAllContextual: Returning bot data. Time taken: ${performance.now() - startTime} milliseconds.`);
this.logger.log(`BotService::findAllContextual: Returning bot data after resolving. Time taken: ${performance.now() - startTime} milliseconds.`);
this.cacheManager.set(cacheKey, botData);
return botData;
});
Expand Down

0 comments on commit f083df1

Please sign in to comment.