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

Only evict Redis cache if keys present #9335

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

pvannierop
Copy link
Contributor

Problem

When evicting the Redis cache when no cache keys are present, the Redisson library throws an error.

Solution

Only evict the cache when there are keys.

@pvannierop pvannierop self-assigned this Feb 24, 2022
@pvannierop pvannierop changed the title Do not evict Redis cache if no keys present Only evict Redis cache if keys present Feb 24, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -110,7 +110,9 @@ public boolean evictIfPresent(Object pattern) {
.filter(key -> key.startsWith(name))
.filter(key -> key.matches((String) pattern))
.toArray(String[]::new);
return redissonClient.getKeys().delete(keys) > 0;
// Calling delete() with empty array causes an error in the Redisson client.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the error out of curiosity?

@alisman alisman added the bug label Feb 25, 2022
@alisman alisman merged commit 9a42b47 into cBioPortal:master Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants