parseTimeDeltaForStopAfter parses a relative time delta string for stop-after configuration. Unlike parseTimeDelta, this function does NOT accept minute or second units. The minimum unit for stop-after is hours. Supported formats: - +25h (25 hours) - +3d (3 days) - +1w (1 week) - +1mo (1 month) - +1
(deltaStr string)
| 54 | // - +1d12h (1 day and 12 hours) |
| 55 | // - +1mo2w3d (1 month, 2 weeks, 3 days) |
| 56 | func parseTimeDeltaForStopAfter(deltaStr string) (*TimeDelta, error) { |
| 57 | return parseTimeDeltaWithMinutes(deltaStr, false) |
| 58 | } |
| 59 | |
| 60 | // parseTimeDeltaWithMinutes parses a relative time delta string with optional minute support |
| 61 | func parseTimeDeltaWithMinutes(deltaStr string, allowMinutes bool) (*TimeDelta, error) { |