Skip to content

Commit

Permalink
Merge pull request #2472 from StateVoicesNational/mz/fix-redis-errors
Browse files Browse the repository at this point in the history
Fix getAsync + delAsync redis errors
  • Loading branch information
mau11 authored Oct 1, 2024
2 parents 680713c + 43aa5d6 commit 93d1041
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/server/models/cacheable_queries/opt-out-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const cacheKey = (orgId, state) =>
const optOutMessageCache = {
clearQuery: async ({ organizationId, state }) => {
if (r.redis) {
await r.redis.delAsync(cacheKey(organizationId, state));
await r.redis.del(cacheKey(organizationId, state));
}
},
query: async ({ organizationId, state }) => {
Expand All @@ -21,7 +21,7 @@ const optOutMessageCache = {
}
if (r.redis) {
const key = cacheKey(organizationId, state);
let message = await r.redis.getAsync(key);
let message = await r.redis.get(key);

if (message !== null) {
return message;
Expand Down
4 changes: 2 additions & 2 deletions src/server/models/cacheable_queries/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const cacheKey = zip => `${process.env.CACHE_PREFIX || ""}state-of-${zip}`;
const zipStateCache = {
clearQuery: async ({ zip }) => {
if (r.redis) {
await r.redis.delAsync(cacheKey(zip));
await r.redis.del(cacheKey(zip));
}
},
query: async ({ zip }) => {
Expand All @@ -41,7 +41,7 @@ const zipStateCache = {

if (r.redis) {
const key = cacheKey(zip);
let state = await r.redis.getAsync(key);
let state = await r.redis.get(key);

if (state !== null) {
return state;
Expand Down

0 comments on commit 93d1041

Please sign in to comment.