Inline method parameter
@@ -70,7 +70,7 @@ public class NodeRepositoryMaintenance extends AbstractComponent {
jobControl = new JobControl(nodeRepository.database());
infrastructureVersions = new InfrastructureVersions(nodeRepository.database());
- nodeFailer = new NodeFailer(deployer, hostLivenessTracker, serviceMonitor, nodeRepository, durationFromEnv("fail_grace").orElse(defaults.failGrace), clock, orchestrator, throttlePolicyFromEnv("throttle_policy").orElse(defaults.throttlePolicy), metric, jobControl, configserverConfig);
+ nodeFailer = new NodeFailer(deployer, hostLivenessTracker, serviceMonitor, nodeRepository, durationFromEnv("fail_grace").orElse(defaults.failGrace), clock, orchestrator, throttlePolicyFromEnv().orElse(defaults.throttlePolicy), metric, jobControl, configserverConfig);
periodicApplicationMaintainer = new PeriodicApplicationMaintainer(deployer, nodeRepository, defaults.redeployMaintainerInterval, durationFromEnv("periodic_redeploy_interval").orElse(defaults.periodicRedeployInterval), jobControl);
operatorChangeApplicationMaintainer = new OperatorChangeApplicationMaintainer(deployer, nodeRepository, clock, durationFromEnv("operator_change_redeploy_interval").orElse(defaults.operatorChangeRedeployInterval), jobControl);
reservationExpirer = new ReservationExpirer(nodeRepository, clock, durationFromEnv("reservation_expiry").orElse(defaults.reservationExpiry), jobControl);
@@ -117,8 +117,8 @@ public class NodeRepositoryMaintenance extends AbstractComponent {
return Optional.ofNullable(System.getenv(envPrefix + envVariable)).map(Long::parseLong).map(Duration::ofSeconds);
}
- private static Optional<NodeFailer.ThrottlePolicy> throttlePolicyFromEnv(String envVariable) {
- String policyName = System.getenv(envPrefix + envVariable);
+ private static Optional<NodeFailer.ThrottlePolicy> throttlePolicyFromEnv() {
+ String policyName = System.getenv(envPrefix + "throttle_policy");
try {
return Optional.ofNullable(policyName).map(NodeFailer.ThrottlePolicy::valueOf);
} catch (IllegalArgumentException e) {
