-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nais preStop hook gir større margin for slengere fra lastbalanserer +…
… graceful shutdown (#2655)
- Loading branch information
Showing
4 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
domene/src/main/java/no/nav/foreldrepenger/selvbetjening/http/PreStopHookController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package no.nav.foreldrepenger.selvbetjening.http; | ||
|
||
import no.nav.security.token.support.core.api.Unprotected; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.time.Duration; | ||
|
||
@RestController | ||
public class PreStopHookController { | ||
private static final Logger LOG = LoggerFactory.getLogger(PreStopHookController.class); | ||
|
||
@Unprotected | ||
@GetMapping("/internal/preStop") | ||
public ResponseEntity<String> preStop() throws InterruptedException { | ||
LOG.info("Mottok kall på /internal/preStop, sover 6 sekunder"); | ||
Thread.sleep(Duration.ofSeconds(6)); | ||
return ResponseEntity.ok().build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters