Inform the user, if a previous "shutdownWorker"-request has been given, in "GeneralController.shutdownWorkerGracefully()"-endpoint.

This commit is contained in:
Lampros Smyrnaios 2023-02-01 16:41:40 +02:00
parent b98ea92dec
commit 13f56d16c0
1 changed files with 8 additions and 2 deletions

View File

@ -46,8 +46,14 @@ public class GeneralController {
if ( responseEntity != null )
return responseEntity;
shouldShutdownWorker = true;
String finalMsg = " The worker will shutdown, after finishing current work.";
String finalMsg = "";
if ( shouldShutdownWorker )
finalMsg = " The worker has already received a \"shutdownWorker\" (which was not canceled afterwards).";
else
shouldShutdownWorker = true;
finalMsg += " The worker will shutdown, after finishing current work.";
logger.info(initMsg + finalMsg);
return ResponseEntity.ok().body(finalMsg);
}