Add command line parameter and fix error message (#13526)

### What problem does this PR solve?

`./server_main -p 9380`

`./server_main -h`

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-03-12 09:50:57 +08:00
committed by GitHub
parent e1b632a7bb
commit 2fb1360d9d
2 changed files with 36 additions and 4 deletions

View File

@@ -119,10 +119,9 @@ func (h *HeartbeatSender) SendHeartbeat() error {
defer resp.Body.Close()
if resp.StatusCode != 200 {
h.logger.Error("Heartbeat request failed",
zap.Int("status_code", resp.StatusCode),
)
return fmt.Errorf("heartbeat request failed with status code: %d", resp.StatusCode)
errMsg := fmt.Errorf("Heartbeat request failed with status code: %d", resp.StatusCode)
h.logger.Warn(errMsg.Error())
return errMsg
}
h.logger.Debug("Heartbeat sent successfully",