jmrwp
Forum Replies Created
-
I have a similar problem on Godaddy, was anyone able to fix this?
I continue to have this problem.
In a typical case, several hundred emails are sent, but then sending stops (probably because the emails are beging temporarily deferred during delivery).
However, the process never seems to restart and the emails stay in the “Sending” state forever.
Well, I figured this out and thought I’d document it here in case someone else has this problem.
The problem was that our site uses the advanced object cache to store some of the results produced by WP. Users that are logged in bypass the cache. So, the login cookie would work for a while, but would eventually expire.
Since wget was not a logged in user, it was repeatedly getting a response from the cache rather then invoking the es=cron?guid=xxxxxxx function via the cron job URL. Thus, the email cron was run only a few times (the first time and then again much later when the cached version expired).
The solution I found was to modify the cron job URL that I called with wget so that it was always unique. I did this by adding an extra parameter (that is ignored by ES).
This is my modified cron job URL:
https://mysite.com/?es=cron&guid=XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX&joetime="date +%s"
(note that the command
date +%s
must be between single backquotes — not double quotes as shown here — so that it invokes that string as a unix command, but I can’t figure out how to make this editor allow me to use formatting…)The stuff after the &joetime= produces a number that will always be unique and thus this URL will never be found in the cache. That way the appropriate ES mail sending method is always invoked.
If you use this method, be sure to put an escape “\” in front of the %+s in the URL, otherwise the cron will get confused by the percent sign.
I hope this helps someone else. Good luck!