Calendars
A Calendar is a mechanism used for excluding blocks of time regardless of the time specification that was supplied. For example, if a job is set to run once a day, it is possible to augment this specification with a calendar to say that it should only run once a day on weekdays. More information is available here.
If a calendar is not provided as part of the JobSpecification, then the default calendar is used.
To define a default calendar, the configuration file has to contain ipf.persistent-scheduler.quartz.calendars.default
and ipf.persistent-scheduler.quartz.calendars as in the example below.
If no default calendar is configured, then the scheduler will not use calendars and the cron expression will be honoured without exclusions.
ipf.persistent-scheduler.quartz.calendars.default = "DefaultCalendar"
ipf.persistent-scheduler {
quartz {
calendars {
DefaultCalendar {
type = Annual
description = "Default calendar"
exclude-dates = ["12-25", "01-01"]
}
}
}
}
Calendar Types
Quartz calendars can be of the following types:
| Calendar type name | Description | Example |
|---|---|---|
|
Exclude blocks of time from a day with a timezone. Use |
exclude {
start-time = "03:00"
end-time = "05:00"
}
timezone = UTC
|
|
Exclude days from a month |
|
|
Exclude days of the week from a week. Days are 1-indexed and start on Sunday, i.e. Sunday = 1, Monday = 2, etc. |
|
|
Exclude by a custom cron expression |
|
|
Exclude explicit dates (useful for moveable feasts like Easter or UK bank holidays) in ISO 8601 |
|
|
Exclude calendar dates from each year in |
|
| A job can only use one calendar. |