UPDATED cache in suggestions
This commit is contained in:
parent
dcb7c54800
commit
7a887f59bc
5 changed files with 70 additions and 21 deletions
|
|
@ -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}`));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue