Commit 1ee38913 authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

catch RedisException of put function as well

parent 178ea184
Pipeline #43766 passed with stages
in 29 minutes and 24 seconds
......@@ -37,18 +37,22 @@ public class ElasticCredentialsCacheImpl extends ElasticCredentialsCache {
@Override
public void put(String s, ClusterSettings o) {
this.cache.put(s, o);
try {
this.cache.put(s, o);
} catch (RedisException ex) {
this.log.error(String.format("Error puttig key %s into redis: %s", s, ex.getMessage()), ex);
}
}
@Override
public ClusterSettings get(String s) {
ClusterSettings cursorSettings = null;
ClusterSettings clusterSettings = null;
try {
cursorSettings = this.cache.get(s);
clusterSettings = this.cache.get(s);
} catch (RedisException ex) {
this.log.error(String.format("Error getting key %s from redis: %s", s, ex.getMessage()), ex);
}
return cursorSettings;
return clusterSettings;
}
@Override
......
......@@ -148,7 +148,11 @@ public class EntitlementsAndCacheServiceImpl implements IEntitlementsExtensionSe
IEntitlementsService service = this.factory.create(headers);
try {
groups = service.getGroups();
this.cache.put(cacheKey, groups);
try {
this.cache.put(cacheKey, groups);
} catch (RedisException ex) {
this.logger.error(String.format("Error putting key %s into redis: %s", cacheKey, ex.getMessage()), ex);
}
this.logger.info("Entitlements cache miss");
} catch (EntitlementsException e) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment