Posted: January 13, 2021 at 12:13 pm
If we are to continue troubleshooting messages we can do that in a new thread as the other is already long and repurposed from an issue with FirstData. However, I once again logged into the site and checked the cron jobs. AHEE__EE_Messages_Scheduler__generation Were missing again but AHEE__EE_Messages_Scheduler__cleanup Was still active. |
|
Why or how can that happen? No one is working on the site. |
|
Unfortunately, I can’t tell you why those cron’s are being removed, they are actually managed by WordPress itself and not Event Espresso. EE activates and calls wp_schedule_event({time}, {frequency}, {hook_name}) to add the scheduled tasks, WordPress than take over and ‘should’ rescheduled the task as it runs, apparently that is failing on your site. In English, it’s like me saying to you ‘Drink water every 5 minutes until I tell you otherwise’ and then leaving you to manage that yourself. If you stop drinking water I don’t know until we next have a catchup. Same idea here, we tell WordPress to run that cron every 5 mins and somewhere that event is lost and not rescheduled, where/why that happens I can’t tell you as it’s not under EE’s control. The |
|
I did log into the site and checked the crons, they are currently showing in the list, although I’ll check this again when I log in in the morning to see if they are still active. |
|
We found some waiting for generating at 10AM and manually sent them. |
|
Yeah so your site is randomly dropping the message crons, they aren’t listed now, but will be again in roughly 3 hours when Any errors in the servers error logs overnight? Memory exhausted errors or any fatal errors, do not just look for errors related to Event Espresso as the schedules tasks are not managed by EE. One thing you can try is increasing the interval time when those crons run using something like this: https://gist.github.com/Pebblo/ee50c033271de885cd907d189532a513 There are reports elsewhere of 1-minute cron events randomly disappearing: https://wordpress.stackexchange.com/questions/158303/scheduled-events-disappear-from-events-queue 5 minutes (which we use) is usually fine (although there are some reports of those disappearing as well) but bump it up to 10 and see if it helps. |
|
OK. I will look into the interval times and watch the results and report back. Here is a response from my server manager: |
|
I two questions: |
|
Neither, that’s a ‘hook’ call back. It’s saying “hook into ‘cron_schedules’ and run ‘tw_ee_increase_message_cron_interval’ to do its thing at priority 100” The code changing the timing of the cron schedule is THIS LINE, setting the interval to 600 seconds (10 Minutes). For more info on hooks, see: https://www.smashingmagazine.com/2011/10/definitive-guide-wordpress-hooks/ |
|
Do you happen to know the times of day the catchup runs? |
|
It runs once daily but due to the way WP_CRON works it’s not exact (because it relies on users hitting the site). If you go to Dashboard -> Tools -> Cron Events Search for ‘AHEE__EE_Messages_Scheduler__cleanup’ and you’ll see when the next runtime is scheduled.
If If Click Add new at the top. Add a standard cron event, hook name is |
|
I just noticed this message at the top of the Cron Events screen: Would that have any impact? |
|
No, I told you to enable alternate wp cron in your other thread here: https://eventespresso.com/topic/how-can-we-find-out-if-firstdata-is-timing-out/#post-319551 The reason for doing so is because loopback requests don’t work on your site and therefor ‘normal’ WP_CRON doesn’t work. |
|
Could I set |
|
You could try it, running the cleanup job more frequently should not cause any issues that I can think of although I do recommend you monitor the site for a little once you’ve changed it just to be safe. |
|
Is there a possibility of a message not being sent within 40 minutes with the above scenario of the cleanup cron only running once per hour? When the cleanup cron runs, might it skip any pending messages or transaction detail sends? |
|
If the cleanup is scheduled for every hour on the hour and the above 2 generating and sending crons are ‘lost’ at say 2 minutes past, then the crons wont be added back into the system until the next cleanup is ran, which will 1 hour+ (the plus is because hit relies on a hit on your site to trigger it). Meaning it is possible to take over 1 hour and 10 minutes (1 hour for cleanup to trigger above, 5 minutes per step for the message queue) plus the time i takes for a user to hit the site after the job has been scheduled.
I can’t think of a reason it would skip them. The cleanup job is just making sure the crons are in place, the cron running would be running as normal. If it w is missing it’s not processing any new messages, when its added again, it will run and pick up where it left off last time it ran. |
|
The support post ‘cron directives are getting removed’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.