Make Multiping run after scheduler in cron
| Project: | Multiping |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
I have a suggestion that would improve Multiping, when it is being used in conjunction with the Scheduler module. Currently the weight of both modules is not changed from the default zero, so during a cron run, Multiping is executed before Scheduler (I believe this is because M comes before S in the alphabet). This means that if Scheduler publishes content then the pings are not sent until the next cron run. If the weight of the Multiping module was set to be heavier than that of Scheduler then it would execute after Scheduler and the pings would therefore be sent during the same cron run as when the content is published.
I think that all you need to do is add the following code to multiping's hook_install()
<?php
$weight = (int)db_result(db_query("SELECT weight FROM {system} WHERE name = 'scheduler'"));
db_query("UPDATE {system} SET weight = %d WHERE name = 'multiping'", $weight + 10);
?>If scheduler is not installed then the above will just set the Multiping weight to 10, which is fine.
What do you think?
Jonathan

#1
I've made a patch for the change.
And while I was at it, I added the standard comment headers and $Id$ required by cvs.
Jonathan