Does anyone know the logic behind what determines the hook_cron execution order?

I have an idea for a simple watchdog enhancement, but need to insure my module's hook_cron runs before the automatic purging of outdated records.

Any insight is appreciated.

Comments

johnhanley’s picture

Just in case anyone is curious, the default execution order of hook_cron (or any hook) is controlled by weight and filename. The weight value is stored in the system table. However the weight column is largely ignored by the system, as practically every module is set to zero by default. Setting the weight of an individual module should most likely occur programmatically in hook_install when the module is first enabled or perhaps with a third-party contributed module.

-------------------------------------------------------

"The sting in any rebuke is the truth." - Benjamin Franklin

flamingvan’s picture

Thank you, Bacteria Man!