Version 9 Sneak Peak: Automated Tasks

We’ve overhauled automated jobs in version 9, adding a lot of new functionality and polish (and building on powerful web components like Symfony Messenger, if you’re familiar with that).

A demo of this functionality is going to be a lot more interesting than trying to describe why it’s better, so I put together this video.

Let me know what you think!

4 Likes

This looks fantastic, really keen to put this new system to good use!

Is the dashboard based task scheduling all based on cron style syntax, or does it use something else?

PS - how awesome is it to have a forum where a video can be embedded to be discussed!

2 Likes

The dashboard scheduling syntax is based on cron. Basically you scheduler the scheduler daemon to run every minute, and it takes care of running the tasks when they’re supposed to be. It uses GitHub - mtdowling/cron-expression: CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due to parse the cron that you schedule with it.

And yes! I am very happy with the discourse update.

This is what I waited for long time because we needed to develop a batch job to sync something on most of our projects.

@andrew are old jobs compatible or do we have to rewrite old custom job classes we have working in v8?

Other question @andrew If I don’t have access to the command line:

  • Can I still use cron jobs the old-fashioned way from cPanel for instance? And where’s the URL to do that?
  • Can I still set the tasks options when scheduling them to run automatically either through cron or through page visits?

The old-fashioned way, no – the task system doesn’t currently support triggering these via URL. However if you have access to cpanel you can easily change this to just run via the console – concrete/bin/concrete5 and run the appropriate task command like concrete/bin/concrete5 task:generate-sitemap` every night at midnight, instead of whatever wget command you were running.

Also, triggering the task scheduler through visiting the website is no longer supported either, currently. Triggering this by scheduling the scheduler to run every minute is much more reliable.

thank you @andrew And how about websites running custom jobs? Will those be compatible and still run or is there no backward compatibility between the old and new job systems?

Jobs should all continue to work. The c5:job command via CLI will also continue to work, as will the old method of running jobs by hitting the jobs endpoint with a browser or curl or wget. In the long term jobs will be removed and replaced by tasks but not until version 10 at the earliest.

I know resurrecting an old post, but oof the new system in v9 is way less intuitive. Heck go back to 5.6 and look at jobs and job sets and how small clean and concise the interface is, let alone has a “default set” so to speak.

Also there is no default set of jobs any more?
What tasks should a basic site be scheduling and how often.?

Previously there was one cron that did the default set of jobs. Now it’s not even close to obvious after adding the scheduler cron that you have to go add the tasks individually to a schedule – no default options.

Don’t get me wrong I know how to schedule a cron but when scheduling tasks you have to know cron syntax or go to an external site to set the times that you want the task to run. This is lazy coding and not intuitive for users if you ask me. I can write cron times but I hate having to think through it, having dropdown type choices of “every 15 min” or something like that, that auto fills would be considerably better.

For the “basic/standard” concrete site tasks I’m not seeing how this is better?