Bug #5422
closedScheduled posts not posting at correct time
0%
Description
Hi,
Scheduled posts on the murphyinstituteblog.org aren't posting at the correct time. (The timezone is set correctly.) If I schedule a post day-of, it posts at the correct time — but if I schedule it the day before or prior, it posts first thing in the morning on the day it's scheduled. This is preventing me from staggering scheduled posts throughout the day.
Some context — a few months back, we were unable to schedule posts at all. See: https://redmine.gc.cuny.edu/issues/4430#change-20259 for information about how this was resolved in case something was triggered through that solution.
Thanks so much,
Leah
Updated by Boone Gorges over 8 years ago
- Assignee set to Boone Gorges
- Target version set to 1.9.14
Hi Leah. Sorry to hear that you're having problems.
Bugs with scheduled posts are extremely hard to debug, especially without full diagnostic information. Specifically, in your case, I'm curious to know what "first thing in the morning on the day it's scheduled" means precisely. Does it mean midnight? What time zone? Same time every day? Etc. I have written a small diagnostic tool that will record some of this info for me whenever a scheduled post is published on the Commons. Next time you schedule a post to be published the next day, could you please take note of whether it's published correctly, and update this ticket with the results? I'll then be able to check my logs to see if any useful information is left there.
Updated by Leah Feder over 8 years ago
Hi Boone,
I just looked at our twitter feed (https://twitter.com/murphyinstitute), since I have auto-posting set up.
April 7th is instructive; that's the day I noticed this problem. It looks like posting started at 5:52am (with another 2 posts at 6:52am, another at 7:52am) and continued until shortly after 9am. So, posts were staggered, but not throughout the day at the times for which they were scheduled.
On April 6th, posts similarly started at 5:52am and then continued at 6:52am and 7:53am.
When I look at the backend to see post times, it looks as if posts went up at the correct time as opposed to early AM.
Thanks for your help,
Leah
Updated by Boone Gorges over 8 years ago
Thanks, Leah. That's helpful. It suggests that the first cron job at 5:52am is publishing a single post, and then it's happening once per hour for remaining future posts. I'll continue to debug as info rolls in.
Updated by Boone Gorges over 8 years ago
- Category name set to WordPress (misc)
- Assignee changed from Boone Gorges to Daniel Jones
- Target version changed from 1.9.14 to 1.9.15
I've had a look in my logs, and I've confirmed that these posts are being published by the cac-fix-missed-schedule.php tool.
Dan, could you have a look? Things to check: Is this a timezone issue (EDT vs UTC/GMT)? Is the date format being returned by `get_the_time( 'G' )` fully-qualified, or is it somehow getting truncated?
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.15 to 1.9.16
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.16 to 1.9.17
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.17 to 1.9.18
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.18 to 1.9.19
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.19 to 1.9.20
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.20 to 1.9.21
Updated by Boone Gorges over 8 years ago
- Target version changed from 1.9.21 to 1.9.22
Updated by Daniel Jones over 8 years ago
Alright so I do think this is a timezone issue. Now everything should be getting converted to UTC/GMT before being compared. Here's the commit: https://github.com/cuny-academic-commons/cac/commit/124db67b7c0ac18332220288609883d0865c00f7
Updated by Boone Gorges over 8 years ago
Thanks, Dan. The change looks correct at a first reading.
I'd like to be able to test the fix after release. What steps should I take? Should I create a post with a scheduled date in the future, and then manually modify the post so that its publish date is in the past, so that it'll be caught by this tool on the next pageload?
Updated by Daniel Jones over 8 years ago
Yes that's what I tried to do, and it seemed to work.
Updated by Boone Gorges over 8 years ago
- Status changed from New to Resolved
Preliminary tests are showing that this worked, so I'm going to cross my fingers and mark Resolved. Thanks for your work, Dan :)