If I understand correctly, job_scheduler_rebuild_all() is called when any module is enabled or disabled. It sets a flag by means of a variable_set(), and the next time cron is run, this flag ensures that job_scheduler_rebuild_scheduler() is called.

It seems to me that having the only way into this process be a module status change is not enough.

For instance, what if a developer changes the period of a schedule in their hook_cron_job_scheduler_info()?
Or if a (hypothetical) schedule UI module dynamically returns schedules in hook_cron_job_scheduler_info(), which change according to UI settings?

It seems to me that this module needs to be able to react to cache clears.

Comments

joachim’s picture

On second thoughts, this is mitigated by the fact it only affects jobs that are defined in the hook.

But then sites that require job scheduling will likely want to declare jobs in the hook so they are under version control...