Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused delayed health check API #992

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,4 @@ public Map<String, Object> healthCheck(HttpServletResponse response) {
map.put("regions", regionService.getAll());
return map;
}

/**
* Return health check message with 1 sec delay. If there is shutdown lock,
* it returns 503. Otherwise, it returns region lists.
*
* @param sleep in milliseconds.
* @param response response
* @return region list
*/
@GetMapping("/check/healthcheck_slow")
public Map<String, Object> healthCheckSlowly(@RequestParam(value = "delay", defaultValue = "1000") int sleep,
HttpServletResponse response) {
ThreadUtils.sleep(sleep);
return healthCheck(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public void testHome() {
@Test
public void testHealthCheck() {
MockHttpServletResponse res = new MockHttpServletResponse();
healthCheckApiController.healthCheck(res);
Map<String, Object> message = healthCheckApiController.healthCheckSlowly(500, res);
Map<String, Object> message = healthCheckApiController.healthCheck(res);
assertEquals(message.get("current"), regionService.getCurrent());
}

Expand Down
Loading