Skip to content

Commit

Permalink
feat: display os info in the rollapp status output (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Oct 29, 2024
1 parent a9340a8 commit 9bdac2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cmd/rollapp/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"slices"
"strconv"
"strings"
Expand Down Expand Up @@ -203,7 +204,9 @@ func PrintOutput(
if withProcessInfo {
pterm.DefaultSection.WithIndentCharacter("💈").
Println("Process Info:")
fmt.Println("PID: ", pid)
fmt.Println("PID:", pid)
fmt.Println("OS:", runtime.GOOS)
fmt.Println("Architecture:", runtime.GOARCH)
}

if isHealthy {
Expand Down
4 changes: 2 additions & 2 deletions cmd/rollapp/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func Cmd() *cobra.Command {
pid, err := os.ReadFile(pidFilePath)
if err != nil {
fmt.Println("failed to read pid file:", err)
return
}

nodeID, err := dymint.GetNodeID(home)
Expand All @@ -42,7 +41,8 @@ func Cmd() *cobra.Command {

ok, msg := healthagent.IsEndpointHealthy("http://localhost:26657/health")
if !ok {
start.PrintOutput(rollerConfig, string(pid), true, false, false, false, nodeID)
// TODO: use options pattern, this is ugly af
start.PrintOutput(rollerConfig, string(pid), true, false, true, false, nodeID)
fmt.Println("Unhealthy Message: ", msg)
return
}
Expand Down

0 comments on commit 9bdac2e

Please sign in to comment.