MCPcopy Create free account
hub / github.com/github/gh-aw / parseDailyBase

Method parseDailyBase

pkg/parser/schedule_parser.go:344–359  ·  view source on GitHub ↗
(hasWeekdaysSuffix bool)

Source from the content-addressed store, hash-verified

342}
343
344func (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
361func (p *ScheduleParser) parseDailyBetween(hasWeekdaysSuffix bool) (string, error) {
362 andIndex, err := p.findDailyBetweenSeparator(hasWeekdaysSuffix)

Callers 1

parseBaseMethod · 0.95

Calls 2

parseDailyBetweenMethod · 0.95
parseDailyAroundMethod · 0.95

Tested by

no test coverage detected