Skip to content

Commit

Permalink
Remove unused delayed health check API (#992)
Browse files Browse the repository at this point in the history
* Remove unused delayed health check API

* Fix test
  • Loading branch information
imbyungjun authored Jan 9, 2024
1 parent 0338146 commit f6d0672
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
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

0 comments on commit f6d0672

Please sign in to comment.