[wp-hackers] post_status = future and pseudo-cron

Peter Westwood peter.westwood at ftwr.co.uk
Fri Feb 10 07:43:42 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Jaquith wrote:
> On Feb 9, 2006, at 9:08 PM, Owen Winkler wrote:
> 
>> Will the pseudocron require that regularly recurring events be
>> rescheduled during each execution?  Calling wp_remove_event() as
>> described could be a problem for recurring events.
> 
> Ick, I hope not.  every_X_minutes, every_X_hours, every_X_ days is the
> way to go.  It's a bit more work initially (writing the backend for it),
> but it will make it much easier for plugin authors... no need to keep
> re-adding things and calculating times and stuff.

Indeed interval based pseudocron is much more powerful than only
allowing single events..

Single events are useful if you want to do something only once - maybe
schedule a theme change for your birthday perhaps?

Storing data with the cronjob itself e.g. post_ID or something else
seems a little dangerous - in the case of publishing future posts do we
really save that much by not querying the DB for the post_ID at publish
time - after all we will have to interact with the DB to do the publish
itself.

I like the idea of every_X_minutes but I think we also need to be able
to specify things like time of day for every_X_days - you want to be
able to schedule things for non-busy times.

An API more like the following may be more useful:

wp_schedule_single_event($unixtimestamp, 'function to call');

wp_schedule_repeating_event('interval-type','interval-amount','time-of-day/hour/week');

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD7EQuVPRdzag0AcURAvLMAJ9FWmhx7o/ieTWgSD92rbk6Lk3rdgCgzvl3
+qHp3Se4uY1oMcKTzFcSsHo=
=mhpb
-----END PGP SIGNATURE-----



More information about the wp-hackers mailing list