[wp-hackers] WP cron and "multi-threading"

Owen Winkler ringmaster at midnightcircus.com
Mon Oct 9 04:00:25 GMT 2006


Mark Jaquith wrote:
> You need to expire the "cron_is_running" option, in case your winning 
> race candidate dies before it gets to unset it.  You could set a 
> separate timestamp option "cron_start_time" and have WP autoload and 
> check that, deleting both options if 15 minutes or so have passed (it's 
> just for emergencies).

> you need to mark the cron as having been run BEFORE the wait time 
> begins, to avoid another race, or do another wait after marking the cron 
> as run but before erasing "cron_is_running"

Grr.  Ok.  Logging success/failure of all of this would be useful, too. 
  Ah, if only you could count on the presence of try-catch exception 
handling.  Alas, PHP4.

So has someone implemented all this already, or what?  I don't want to 
waste days testing cron anomalies if someone's already got the code 
written.  Pony up.

Owen




More information about the wp-hackers mailing list