Cron-code

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cron-code

Robert Deaton
Okay, been looking at the cron code, as I had an idea for something I
wanted to write up and submit as a patch. However, I'm at a loss
looking at some of the code, and hopefully someone can tell me I'm an
idiot and slap me in the head with a stick. First off, I don't see
anywhere in the code where the hook would be fired, a function called,
or anything, I'm at a complete loss. Second, I'm 90% certain this is a
bug:

function wp_clear_scheduled_hook($hook) {
        while($timestamp = next_scheduled('scheduled_hook'))
                wp_unschedule_event($timestamp, 'scheduled_hook');
}

Shouldn't those 'scheduled_hook' strings actually be the $hook that's
being passed in? How would we unschedule an event like that, if
they're stored by an arbitrary hook name?

--
--Robert Deaton
http://somethingunpredictable.com

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Cron-code

Robert Deaton
I take back part A), I now see it, I'm just blind as a bat.

--
--Robert Deaton
http://somethingunpredictable.com

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Cron-code

Ryan Boren
In reply to this post by Robert Deaton
Robert Deaton wrote:

 > Second, I'm 90% certain this is a

> bug:
>
> function wp_clear_scheduled_hook($hook) {
> while($timestamp = next_scheduled('scheduled_hook'))
> wp_unschedule_event($timestamp, 'scheduled_hook');
> }
>
> Shouldn't those 'scheduled_hook' strings actually be the $hook that's
> being passed in? How would we unschedule an event like that, if
> they're stored by an arbitrary hook name?

Looks like a bug to me.  Submit a bug and a patch that works for you if
you have time, otherwise I'll get to it.

The cron stuff hasn't had a lot of use or testing.  If there is anything
you need added, changed, or fixed, shout.

Ryan
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers