Files
query-orchestration/cmd/healthcheck/main.go
T
Jay Brown a6e081e5cd Merged in feature/log-version (pull request #185)
inject and print version at startup for all services

* inject and print version

* coverage
2025-09-18 21:06:21 +00:00

34 lines
522 B
Go

// cmd/healthcheck/main.go
package main
import (
"errors"
"net/http"
"os"
"queryorchestration/internal/serviceconfig/build"
)
func main() {
// Print version information before any environment checks
build.PrintVersionInfo("healthcheck")
err := check()
if err != nil {
os.Exit(1)
}
}
func check() error {
resp, err := http.Get("http://localhost:8080/health")
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return errors.New("Status code not OK")
}
return nil
}