MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / formatRetryDelay

Function formatRetryDelay

tui/status.go:205–221  ·  view source on GitHub ↗
(delay time.Duration)

Source from the content-addressed store, hash-verified

203}
204
205func formatRetryDelay(delay time.Duration) string {
206 if delay <= 0 {
207 return "now"
208 }
209
210 seconds := int((delay + time.Second - 1) / time.Second)
211 if seconds < 60 {
212 return fmt.Sprintf("%ds", seconds)
213 }
214
215 minutes := seconds / 60
216 remainingSeconds := seconds % 60
217 if remainingSeconds == 0 {
218 return fmt.Sprintf("%dm", minutes)
219 }
220 return fmt.Sprintf("%dm %02ds", minutes, remainingSeconds)
221}
222
223func statusRefreshErrorMessage(err error, retryAt time.Time) string {
224 delay := time.Until(retryAt)

Callers 2

ViewMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected