(delay time.Duration)
| 203 | } |
| 204 | |
| 205 | func 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 | |
| 223 | func statusRefreshErrorMessage(err error, retryAt time.Time) string { |
| 224 | delay := time.Until(retryAt) |
no outgoing calls
no test coverage detected