Skip to content

Commit

Permalink
string
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Dec 15, 2023
1 parent 3ef003b commit 2236029
Showing 1 changed file with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@
@Slf4j
@RequiredArgsConstructor
public class BackendAndDatabaseHealthIndicator implements HealthIndicator {
private final FeatureFlagRepository _ffRepo;
private final OktaRepository _oktaRepo;
private final FeatureFlagRepository _ffRepo;
private final OktaRepository _oktaRepo;

@Override
public Health health() {
try {
_ffRepo.findAll();
String oktaStatus = _oktaRepo.getApplicationStatusForHealthCheck();
@Override
public Health health() {
try {
_ffRepo.findAll();
String oktaStatus = _oktaRepo.getApplicationStatusForHealthCheck();

if (oktaStatus.equals("ACTIVE")) {
log.info("Okta status didn't return active, instead returned", oktaStatus);
return Health.down().build();
}
if (oktaStatus.equals("ACTIVE")) {
log.info("Okta status didn't return active, instead returned %s", oktaStatus);
return Health.down().build();
}

return Health.up().build();
} catch (JDBCConnectionException e) {
return Health.down().build();
// Okta API call errored
} catch (ApiException e) {
log.info(e.getMessage());
return Health.down().build();
return Health.up().build();
} catch (JDBCConnectionException e) {
return Health.down().build();
// Okta API call errored
} catch (ApiException e) {
log.info(e.getMessage());
return Health.down().build();
}
}
}
}

0 comments on commit 2236029

Please sign in to comment.