36 Background tasks and the scheduler
Work that does not belong in a transaction runs in the database's task queue: text indexing,
embeddings, backups, log rewrites, and tasks your own code queues with EnqueueTask. The
scheduler runs jobs through that queue at set times: a backup every night, a log truncation
every Sunday, a report of your own every fifteen minutes on working days.
- A job is work registered under a name. The database brings its own maintenance jobs, and your code can add more.
- A schedule says which job runs when. Schedules are settings,
LocalSettings.Schedulesinrelatude.db.json, so they are deployed with the application. The admin UI can also set them on one installation, inrelatude.db.overrides.json(§12).
Every run, scheduled or started by hand, is a batch in the task queue and shows on the Tasks page. Up to four different jobs run at once, but two runs of the same job never do. A long run takes only its own slot, so backups and other jobs run beside it.
- 36.1 Jobs — The database registers these jobs itself:
- 36.2 Schedules — How the times work: Below a day, runs follow the interval from At until Until, and the next day starts again at At, as in cron. So every 7 hours leaves a shorter gap before midnight. Intervals of several days, weeks or…
- 36.3 The Scheduler page — Tasks › Scheduler in the admin UI lists the schedules with their next and last runs, the jobs with the arguments they take, and the recent runs. There you can add, change, turn off, remove and run schedules, start any…