Skip to content

Commit

Permalink
By default don't start http server
Browse files Browse the repository at this point in the history
  • Loading branch information
p2004a committed Sep 3, 2023
1 parent 9d2d2b9 commit bf0a3e8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/replicationprober/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type config struct {
CheckRedirectStatusPeriod time.Duration `envDefault:"2m"`
EnableStorageReplicationProber bool `envDefault:"true"`
EnableRedirectStatusProber bool `envDefault:"true"`
Port string `envDefault:"8080"`
Port string `envDefault:"disabled"`
}

func main() {
Expand All @@ -60,7 +60,6 @@ func main() {
UseFieldNameByDefault: true,
}); err != nil {
log.Fatalf("%+v\n", err)

}

bunnyClient := bunny.NewClient(cfg.Bunny.AccessKey)
Expand Down Expand Up @@ -132,7 +131,11 @@ func main() {
}
http.HandleFunc("/replicationstatus_versiongz", versionGzFetcher.HandleReplicationStatusVersionsGz)

if err := http.ListenAndServe(":"+cfg.Port, nil); err != nil {
log.Fatal(err)
if cfg.Port == "disabled" {
select {}
} else {
if err := http.ListenAndServe(":"+cfg.Port, nil); err != nil {
log.Fatal(err)
}
}
}

0 comments on commit bf0a3e8

Please sign in to comment.