[wp-hackers] Pseudo-Cron
Otto
otto at ottodestruct.com
Fri Sep 21 21:14:53 GMT 2007
Okay, I see what I was missing now.
wp_reschedule_event is used by wp-cron.php. When a recurring event is
scheduled, it calls this function to schedule the next recurring
event.
This means that for any recurring event, only the next recurrance of
it is actually scheduled. When the event finally gets around to
running, wp-cron reschedules it by creating a new event in the future,
then it unschedules the existing event, then it runs the hook.
This also means that calling wp_unschedule_event on a recurring one
unschedules the whole event, recurrances and all.
On 9/21/07, Otto <otto at ottodestruct.com> wrote:
> Hmm... Maybe my description was incorrect. From what I see, it will
> schedule a new event at first point in time that's in the future,
> given a starting point and a recurrance interval.
>
> Normally, if I schedule something in the past, it will run on the very
> next hit to the site. But this function will push that interval in
> there up to the point where it schedules in the future, at the next
> correct time given the starting point and the interval.
>
> I'm uncertain if that's intended behavior or not. If it is, then the
> function name is pretty poorly chosen.
>
>
>
>
> On 9/21/07, Jennifer Hodgdon <yahgrp at poplarware.com> wrote:
> > One more questions for Otto/group:
> >
> > Otto wrote:
> > > function wp_reschedule_event( $timestamp, $recurrence, $hook, $args =
> > > array()) - Reschedules a given event. There's not a lot of reasons to
> > > use this.
> >
> > From the name of this function, I thought it would first unschedule
> > the originally-scheduled event, then put it into the schedule again.
> > But looking at the code, it looks to me as though all this function
> > does is make sure that $timestamp is in the future, and then call
> > wp_schedule_event. Am I missing something?
> >
> > --Jennifer
> >
> > --
> > Jennifer Hodgdon
> >
> > Poplar ProductivityWare * www.poplarware.com
> > Web Databases/Scripts * Modeling/Analysis/Palm OS Software
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
More information about the wp-hackers
mailing list