UPDATED cache in suggestions

This commit is contained in:
redesyef 2024-09-25 16:06:28 -05:00
parent dcb7c54800
commit 7a887f59bc
5 changed files with 70 additions and 21 deletions

View file

@ -39,7 +39,7 @@ app.use(async (req: Request, res: Response, next: NextFunction) => {
const result = originalSend(body);
redisClient
.setEx(cacheKey, 3600, JSON.stringify(body))
.setEx(cacheKey, 86400, JSON.stringify(body))
.then(() => logger.info(`Cache set for ${cacheKey}`))
.catch((err) => logger.error(`Redis setEx error: ${err}`));