diff --git a/orcid-api-common/src/main/resources/orcid-oauth2-api-common-config.xml b/orcid-api-common/src/main/resources/orcid-oauth2-api-common-config.xml index a97fca78480..89682ff1873 100644 --- a/orcid-api-common/src/main/resources/orcid-oauth2-api-common-config.xml +++ b/orcid-api-common/src/main/resources/orcid-oauth2-api-common-config.xml @@ -131,5 +131,6 @@ + \ No newline at end of file diff --git a/orcid-core/src/main/java/org/orcid/core/utils/cache/redis/RedisClient.java b/orcid-core/src/main/java/org/orcid/core/utils/cache/redis/RedisClient.java index 42affcf8f47..bc09b7f234d 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/cache/redis/RedisClient.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/cache/redis/RedisClient.java @@ -11,6 +11,7 @@ import org.orcid.utils.alerting.SlackManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import redis.clients.jedis.DefaultJedisClientConfig; import redis.clients.jedis.HostAndPort; @@ -24,7 +25,7 @@ public class RedisClient { private static final Logger LOG = LoggerFactory.getLogger(RedisClient.class); private static final int DEFAULT_CACHE_EXPIRY = 60; - private static final int DEFAULT_TIMEOUT = 5000; + private static final int DEFAULT_TIMEOUT = 10000; private final String redisHost; private final int redisPort; @@ -37,7 +38,7 @@ public class RedisClient { @Resource private SlackManager slackManager; - // Assume the connection to Redis is disabled by default + // Assume the connection to Redis is disabled by default private boolean enabled = false; public RedisClient(String redisHost, int redisPort, String password) { @@ -66,10 +67,6 @@ public RedisClient(String redisHost, int redisPort, String password, int cacheEx @PostConstruct private void init() { - if(!enabled) { - LOG.debug("Redis is not enabled, so, it will not be initilized"); - return; - } try { JedisClientConfig config = DefaultJedisClientConfig.builder().connectionTimeoutMillis(this.clientTimeoutInMillis).timeoutMillis(this.clientTimeoutInMillis) .socketTimeoutMillis(this.clientTimeoutInMillis).password(this.redisPassword).ssl(true).build(); diff --git a/orcid-core/src/main/resources/orcid-core-context.xml b/orcid-core/src/main/resources/orcid-core-context.xml index 76f109dc3ca..94f24f912bd 100644 --- a/orcid-core/src/main/resources/orcid-core-context.xml +++ b/orcid-core/src/main/resources/orcid-core-context.xml @@ -1212,6 +1212,7 @@ +