Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: delete from redis if keys are available #1095

Merged
merged 3 commits into from
Dec 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: only delete from store if there are keys to delete
  • Loading branch information
saihaj committed Dec 14, 2021
commit 2cb6d7a0d84f416912b222711ebceb20eaa9ed6c
4 changes: 3 additions & 1 deletion packages/plugins/response-cache-redis/src/redis-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export const createRedisCache = (params: RedisCacheParameter): Cache => {
invalidationKeys.push(await buildEntityInvalidationsKeys(id != null ? buildRedisEntityId(typename, id) : typename));
}

await store.del(invalidationKeys.flat());
if (invalidationKeys.length > 0) {
await store.del(invalidationKeys.flat());
}
},
};
};
Expand Down