(hasWeekdaysSuffix bool)
| 342 | } |
| 343 | |
| 344 | func (p *ScheduleParser) parseDailyBase(hasWeekdaysSuffix bool) (string, error) { |
| 345 | if len(p.tokens) == 1 || (len(p.tokens) == 3 && hasWeekdaysSuffix) { |
| 346 | if hasWeekdaysSuffix { |
| 347 | return "FUZZY:DAILY_WEEKDAYS * * *", nil |
| 348 | } |
| 349 | return "FUZZY:DAILY * * *", nil |
| 350 | } |
| 351 | switch p.tokens[1] { |
| 352 | case "between": |
| 353 | return p.parseDailyBetween(hasWeekdaysSuffix) |
| 354 | case "around": |
| 355 | return p.parseDailyAround(hasWeekdaysSuffix) |
| 356 | default: |
| 357 | return "", errors.New("'daily at <time>' syntax is not supported. Use fuzzy schedules like 'daily' (scattered), 'daily around <time>', or 'daily between <start> and <end>' for load distribution. For fixed times, use standard cron syntax (e.g., '0 14 * * *')") |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | func (p *ScheduleParser) parseDailyBetween(hasWeekdaysSuffix bool) (string, error) { |
| 362 | andIndex, err := p.findDailyBetweenSeparator(hasWeekdaysSuffix) |
no test coverage detected