Skip to content

Commit 6b7588a

Browse files
committed
Don't sleep when being probed for readiness
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 5cae68b commit 6b7588a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sleep/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ func init() {
2222
// of time between those two figures
2323
func Handle(req []byte) string {
2424

25+
if v := os.Getenv("Http_Path"); v == "/_/ready" {
26+
return "ok"
27+
}
28+
2529
if minV, ok := os.LookupEnv("Http_X_Min_Sleep"); ok && len(minV) > 0 {
2630
if maxV, ok := os.LookupEnv("Http_X_Max_Sleep"); ok && len(maxV) > 0 {
2731
minSleep, _ := time.ParseDuration(minV)

0 commit comments

Comments
 (0)