Skip to content

Commit

Permalink
Chore: Update redis
Browse files Browse the repository at this point in the history
  • Loading branch information
sandygudie committed Jul 5, 2024
1 parent d584c2b commit f428468
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions API/src/middlewares/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ async function initializeRedisClient() {
}
}

async function updateCached(req, data) {
const see = await redisClient.keys("*");
console.log(see);
const reqDataToHash = {
query: req.query,
body: req.body,
};
// async function updateCached(req, data) {
// await redisClient.keys("*");

const key = `/@${hash.sha1(reqDataToHash)}`;
if (key) await writeData(key, data);
}
// const reqDataToHash = {
// query: req.query,
// body: req.body,
// };

// const key = `/@${hash.sha1(reqDataToHash)}`;
// if (key) await writeData(key, data);
// }

function requestToKey(req) {
const reqDataToHash = {
Expand Down Expand Up @@ -99,4 +99,4 @@ function redisCacheMiddleware() {
};
}

module.exports = { initializeRedisClient, updateCached, redisCacheMiddleware };
module.exports = { initializeRedisClient, redisCacheMiddleware };

0 comments on commit f428468

Please sign in to comment.