Skip to content

Commit f1c0e9b

Browse files
Merge pull request #106 from Netflix/feature/ignoreEurekaStatus
EVCACHE-454: Ignore application eureka status.
2 parents b8ab182 + 430358d commit f1c0e9b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

evcache-client/src/main/java/com/netflix/evcache/pool/eureka/EurekaNodeListProvider.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ public EurekaNodeListProvider(ApplicationInfoManager applicationInfoManager, Eur
5656
*/
5757
@Override
5858
public Map<ServerGroup, EVCacheServerGroupConfig> discoverInstances(String _appName) throws IOException {
59-
if ((applicationInfoManager.getInfo().getStatus() == InstanceStatus.DOWN)) {
59+
final Property<Boolean> ignoreAppEurekaStatus = props.get("evcache.ignoreAppEurekaStatus", Boolean.class).orElse(false);
60+
61+
if (ignoreAppEurekaStatus.get())
62+
log.info("Not going to consider the eureka status of the application, to initialize evcache client.");
63+
64+
if (!ignoreAppEurekaStatus.get() && (applicationInfoManager.getInfo().getStatus() == InstanceStatus.DOWN)) {
65+
log.info("Not initializing evcache client as application eureka status is DOWN. " +
66+
"One can override this behavior by setting evcache.ignoreAppEurekaStatus property to true, scoped to your application.");
6067
return Collections.<ServerGroup, EVCacheServerGroupConfig> emptyMap();
6168
}
6269

0 commit comments

Comments
 (0)