Make Multiping run after scheduler in cron

jonathan1055 - February 8, 2009 - 12:44
Project:Multiping
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

jonathan1055 - April 22, 2009 - 15:38
Status:active» needs review

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

AttachmentSize
_multiping.module_weight.patch.txt 1.22 KB
 
 

Drupal is a registered trademark of Dries Buytaert.