A thousand little victories

By Serdar Yegulalp | 2016/04/01 10:00

[Just so you know: this isn't an April Fools' joke. I hate that stuff.]

Creating a project this huge means having a thousand little things go right one after the other, all adding up to one big victory: something from nothing. Today, if you can read this -- and I'm assuming you can, because I can -- we've scored another one: the first functioning version of the scheduled-publishing feature.

Posts in MTL can be set to publish at some point in the future. A script in the MTL tree runs when invoked by a cron job to look for any posts whose scheduled publication date is current or passed, and makes them live. The script can also be invoked on-demand, and as it becomes more robust I may see about allowing the AJAX method we use to run the queue with some invocation of that script instead.

Some production-crucial pieces of the script aren't working yet. For instance, I'm still dealing with how to handle an exceptional condition in the queue -- do I stop the queue and put a marker in there that the blog's publication queue has a blocking condition, or flush the queue entirely and log an error, etc.? But when there's nothing else in the way, it works properly.

(Side note: I'm thinking logging an error and flushing out the queue might be a good place to start, although it obviously won't hold up on big jobs. But it would at least keep the queue from breaking perpetually whenever there's a single problem.)

Tags: features publishing scheduled tasks

comments powered by Disqus