Schedulers
Overview
Sugar provides a Scheduler service that can execute predefined functions asynchronously on a periodic basis. The Scheduler integrates with external UNIX systems and Windows systems to run jobs that are scheduled through those systems. The typical configuration is to have a UNIX cron job or a Windows scheduled job execute the Sugar Scheduler service every couple of minutes. The Scheduler service checks the list of Schedulers defined in the Scheduler Admin screen and executes any that are currently due.
A series of schedulers are defined by default with every Sugar installation. For detailed information on these stock schedulers, please refer to the Schedulers documentation.
Config Settings
- cron.max_cron_jobs - Determines the maximum number of jobs executed per cron run
- cron.max_cron_runtime - Determines the maximum amount of time a job can run before forcing a failure
- cron.min_cron_interval - Specified the minimum amount of time between cron runs
Considerations
- Schedulers execute the next time the cron runs after the interval of time has passed, which may not be at the exact time specified on the scheduler.
- If you see the message "Job runs too frequently, throttled to protect the system" in the Sugar log, the cron is running too frequently.
- If you would prefer the cron to run more frequently, set the cron.min_cron_interval setting to 0 and disable throttling completely.
Topics
In addition to the default schedulers that are packaged with Sugar, developers can create custom scheduler jobs.