Skip to content

Commit 5e818cb

Browse files
committed
Fix
1 parent 4ce8f05 commit 5e818cb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

command/ota/status.go

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func PrintOtaStatus(otaid, otaids, device string, cred *config.Credentials, limi
4747
FirmwareSize: res.Ota.FirmwareSize,
4848
Ota: res.Ota,
4949
Details: res.States,
50+
MaxRetries: res.Ota.MaxRetries,
51+
RetryAttempt: res.Ota.RetryAttempt,
5052
})
5153
} else if err != nil {
5254
return err

internal/ota-api/dto.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ type (
6161

6262
OtaStatusDetail struct {
6363
FirmwareSize int64 `json:"firmware_size,omitempty"`
64+
MaxRetries int64 `json:"max_retries,omitempty"`
65+
RetryAttempt int64 `json:"retry_attempt,omitempty"`
6466
Ota Ota `json:"ota"`
6567
Details []State `json:"details,omitempty"`
6668
}
@@ -84,7 +86,7 @@ func (r OtaStatusList) String() string {
8486
}
8587

8688
if hasErrorReason {
87-
t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason")
89+
t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason", "Retry Attempt")
8890
} else {
8991
t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At")
9092
}
@@ -94,6 +96,7 @@ func (r OtaStatusList) String() string {
9496
line := []any{r.DeviceID, r.ID, r.MapStatus(), formatHumanReadableTs(r.StartedAt), formatHumanReadableTs(r.EndedAt)}
9597
if hasErrorReason {
9698
line = append(line, r.ErrorReason)
99+
line = append(line, r.RetryAttempt)
97100
}
98101
t.AddRow(line...)
99102
}

0 commit comments

Comments
 (0)