Cron jobs
One of the advanced, but still essential, settings for YAFFA is the configuration of cron jobs. Cron jobs are scheduled tasks that run at specific intervals. YAFFA uses cron jobs to perform various tasks, such as
- updating exchange rates,
- download investment prices,
- cache certain values to speed up the application,
- automatically record recurring transactions,
- keep the active state of schedules and budgets up to date (daily),
- delete old, finalized AI documents, if a user turned on the retention setting (daily, at 03:30),
- remove expired API tokens (daily).
Setting up cron jobs depends on your server environment. The generic guideline is available in the Laravel task scheduling documentation.
Which instance runs the tasks
The tasks above only run on the instance where RUNS_SCHEDULER is enabled. Enable it on exactly one instance: if none has it, the daily tasks never run, and if several have it, tasks run more than once (for example, users could receive duplicate reminder emails). In the Docker Compose setup, this is already taken care of: the scheduler container has it enabled, and the app container does not. See advanced configuration.
Queue worker and emails
Some of the tasks dispatch queued jobs. A queue worker needs to be running for them to be processed, and the reminder emails sent by the AI document cleanup also need working outgoing email.