Skip to content

Commit

Permalink
Merge pull request #106 from Netflix/feature/ignoreEurekaStatus
Browse files Browse the repository at this point in the history
EVCACHE-454: Ignore application eureka status.
  • Loading branch information
arunagrawal-84 authored Mar 24, 2021
2 parents b8ab182 + 430358d commit f1c0e9b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ public EurekaNodeListProvider(ApplicationInfoManager applicationInfoManager, Eur
*/
@Override
public Map<ServerGroup, EVCacheServerGroupConfig> discoverInstances(String _appName) throws IOException {
if ((applicationInfoManager.getInfo().getStatus() == InstanceStatus.DOWN)) {
final Property<Boolean> ignoreAppEurekaStatus = props.get("evcache.ignoreAppEurekaStatus", Boolean.class).orElse(false);

if (ignoreAppEurekaStatus.get())
log.info("Not going to consider the eureka status of the application, to initialize evcache client.");

if (!ignoreAppEurekaStatus.get() && (applicationInfoManager.getInfo().getStatus() == InstanceStatus.DOWN)) {
log.info("Not initializing evcache client as application eureka status is DOWN. " +
"One can override this behavior by setting evcache.ignoreAppEurekaStatus property to true, scoped to your application.");
return Collections.<ServerGroup, EVCacheServerGroupConfig> emptyMap();
}

Expand Down

0 comments on commit f1c0e9b

Please sign in to comment.