[wp-hackers] wp_schedule_event being triggered multiple times
Andrew Ferguson
andrew at fergcorp.com
Tue Feb 27 05:05:02 GMT 2007
I actually took a look at the mySQL entry to see if I could figure out when
the emails were being posted. As it turns out, the post does get it's time
stamp from the email.
On 2/26/07, Callum Macdonald <lists.automattic.com at callum-macdonald.com>
wrote:
>
> Hey Andrew,
>
> I'll precede this suggestion by saying I'm not an expert... :)
>
> Does the post get its timestamp from the date on the email? Could it be
> that the email is being posted multiple times, once per hour, and not
> being deleted or not recorded that it has already been posted? If you
> check the site just after the hourly cron job, and it's been posted 12
> times, then obviously this is not the case!
>
> Good luck,
>
>
> Callum.
>
> Andrew Ferguson wrote:
> > I'm working on a plugin that uses uses the inbuilt cron system to
> > check for
> > Blogs by email.
> >
> > I'm having an issue where emails are posted several times over. For
> > example,
> > I would send an email to the account specified. The plugin would
> > perform its
> > hourly check, I would check the site later and I would see multiple
> > (somewhere between 1-12) posts of the email, each with same time
> > stamp. My
> > best guess is that multiple hits are occurring at the moment the cron'd
> > event should be triggered. This causes the the event to execute multiple
> > times before some setting is updated to prevent further executions for
> > this
> > round (i.e. prevent it from executing this hour). Like I said, my best
> > guess.
> >
> > Here's the code (being released under GPL):
> >
> > function fergcorp_checkEmailPosts(){
> >
> > $handle = fopen(get_bloginfo('wpurl')."/wp-mail.php", "r");
> > fclose($handle);
> >
> > }
> >
> > add_action('fergcorp_checkEmailPosts_hook', 'fergcorp_checkEmailPosts'
> );
> >
> > if (!wp_next_scheduled('fergcorp_checkEmailPosts_hook')) {
> > wp_schedule_event( time(), 'hourly',
> > 'fergcorp_checkEmailPosts_hook' );
> > }
> >
> >
> > Any ideas?
> >
> > -Andrew Ferguson
> > http://www.andrewferguson.net
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
> _______________________________________________
> 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