Skip to content

Commit

Permalink
fix: fix dbname and status message in healthcheck (#457)
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore authored Nov 14, 2023
1 parent 0254f8c commit 0042f2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pitr/cli/internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ func checkAgentServerStatus(lsBackup *model.LsBackup) bool {
as := pkg.NewAgentServer(fmt.Sprintf("%s:%d", convertLocalhost(sn.IP), AgentPort))
in := &model.HealthCheckIn{
DBPort: sn.Port,
DBName: convertLocalhost(sn.IP),
DBName: sn.Database,
Username: sn.Username,
Password: sn.Password,
}
if err := as.CheckStatus(in); err != nil {
statusList = append(statusList, &model.AgentServerStatus{IP: sn.IP, Port: AgentPort, Status: "Unavailable"})
statusList = append(statusList, &model.AgentServerStatus{IP: sn.IP, Port: AgentPort, Status: fmt.Sprintf("Unavailable: %s", err)})
available = false
} else {
statusList = append(statusList, &model.AgentServerStatus{IP: sn.IP, Port: AgentPort, Status: "Available"})
Expand Down

0 comments on commit 0042f2c

Please sign in to comment.