Skip to content

Commit 212c95a

Browse files
authored
Merge pull request #173 from kmala/health
fix(healthcheck): Don't fail if there is no healthcheck for a proctype
2 parents 55247cf + 4f2d342 commit 212c95a

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

cmd/healthchecks.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"errors"
54
"fmt"
65
"io"
76
"os"
@@ -41,18 +40,11 @@ func HealthchecksList(appID, procType string) error {
4140
}
4241

4342
fmt.Printf("=== %s Healthchecks\n\n", appID)
44-
if procType == "" {
45-
for proc, healthcheck := range config.Healthcheck {
46-
fmt.Println(proc + ":")
47-
printHealthCheck(os.Stdout, *healthcheck)
48-
}
43+
fmt.Println(procType + ":")
44+
if healthcheck, found := config.Healthcheck[procType]; found {
45+
printHealthCheck(os.Stdout, *healthcheck)
4946
} else {
50-
fmt.Println(procType + ":")
51-
if healthcheck, found := config.Healthcheck[procType]; found {
52-
printHealthCheck(os.Stdout, *healthcheck)
53-
} else {
54-
return errors.New(appID + " doesn't have proctype" + procType)
55-
}
47+
printHealthCheck(os.Stdout, api.Healthchecks{})
5648
}
5749

5850
return nil

0 commit comments

Comments
 (0)