Skip to content

Commit

Permalink
Merge pull request #18 from BouyguesTelecom/improve/dx-docker-compose
Browse files Browse the repository at this point in the history
fix api with redis catalog
  • Loading branch information
AmelieLoulergue authored Dec 1, 2024
2 parents 46884f1 + 0e539e5 commit 1ccf22f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/middleware/redisMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export const redisConnectionMiddleware = async (req: Request, res: Response, nex
await redisHandler.connectClient();

res.on('finish', async () => {
await redisHandler.disconnectClient();
if (!req.url.includes('delegated-storage')) {
await redisHandler.disconnectClient();
}
});

next();
} catch (error) {
logger.error(`Redis connection error: ${error.message}`);
} catch ( error ) {
logger.error(`Redis connection error: ${ error.message }`);
res.status(500).json({ error: 'Internal Server Error' });
}
};

0 comments on commit 1ccf22f

Please sign in to comment.