Support

Akeeba Ticket System

#38478 MailFetch and Joomla Task Scheduler

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.2.7
PHP version
8.0.23
Akeeba Ticket System version
5.2.2

Latest post by [email protected] on Tuesday, 07 February 2023 09:34 CST

[email protected]

 Hello,

I was just checking in to see if there the possibility of integration of Akeeba Tickets mailfetch with the Joomla Task Scheduler? I see that support has been added for Akeeba Backup.

Thanks,

Eric

nicholas
Akeeba Staff
Manager

We could, in theory. It's not hard at all. However, there are practical problems we saw with our integrations in Akeeba Backup and Admin Tools which make me believe that Scheduled Tasks may not be the best approach for any Joomla user, regardless of their experience level and expectations, especially for Mail Fetch in ATS.

If we keep the current ats plugins you need to configure these plugins, not the Scheduled Task itself, to determine what the scheduled task will do. This is necessary for our own web CRON URL implementation which predates Joomla Scheduled Tasks by several years to work. This will annoy people who expect the configuration to be in the Scheduled Task itself. This will be a constant battle to explain but it's merely annoying, not a show stopper.

If we kill those plugins and go with Scheduled Tasks we a. remove all the configuration you've already made, including the mail fetching (ouch!); and b. break hard any sites using either the CRON jobs or our own web CRON URL to trigger ATS' housekeeping tasks. That is to say, you'd install an update and it would break your site. This is… doubleplusungood. So, this approach is dead before we even start thinking about it.

The third option is to have the same code twice, once with the ats plugins for existing clients and once more as a Joomla Scheduled Tasks plugin for new clients. This is insanity. Code duplication mathematically leads to bugs, regressions, and an overall bad time. So that approach is dead in the water as well.

Assuming that we keep the first approach of just slapping Scheduled Tasks to the whole shebang, we have to ask ourselves: does it result in something that is better in any way than the status quo? Frankly, I am not convinced that Scheduled Tasks are any better than existing scheduling options.

First of all, the argument that “everyone” can use them hinges on the possibility to run all of your scheduled tasks using the Lazy Scheduling. However, Lazy Scheduling is only good for quick and easy tasks, like toggling the offline mode, or publishing/unpublishing a limited number of articles on a (rough) schedule. Anything that requires a significant amount of work and/or is time critical —like fetching emails, or taking backups, or scanning the site for changed PHP files— needs to either run through CLI (therefore the entire long process runs in one go at a predictable time), or have a predictable request time and cadence (when using web CRON). None of these requirements are met by Lazy Scheduling.

Using a web CRON or real (CLI) CRON job is possible with Scheduled Tasks… but then it's no longer accessible to “everyone”. The site owner needs to know how to set up the web CRON or CLI CRON job for Joomla's Scheduled Tasks, something which is not explained anywhere in Joomla's documentation! So, from a 3PD's point of view, not only I have to do extra work to implement integration with Joomla Scheduled Tasks, but I need to document and support a core Joomla feature that's not under my control, and whose limitations and weird behaviour I do know but can't address! It's a lose-lose situation.

Speaking of which, Scheduled Tasks are far more limited in their scheduling than CRON jobs. One of the selling points of Scheduled Tasks was that you don't have to understand CRON expressions to schedule a task. You can just chose, let's say, “Every hour”. However, you'd be utterly surprised to find out that every hour it is not! It's actually “at least one hour after the last execution”. You expected your scheduled tasks to run exactly at noon, 1pm, 2pm etc? Nope! Since the scheduled tasks execution may not come at exactly the time you specified (e.g. because there is not enough traffic with lazy scheduling, there are other tasks in front of yours in Joomla's queue, the calls to Joomla's web CRON or CLI CRON endpoint are not granular enough etc) you may end up with your task executing at 12:13pm, 1:56pm, and 3:00pm. And that's even if Joomla's scheduled tasks CRON executed at exactly 1pm and 2pm — because you had essentially told Joomla to wait at least an hour between consecutive executions. This would be detrimental for email fetching as "once every 5 minutes" could become "about five times a day, if you're lucky" which is pretty useless. We don't want to have to explain this and expect our clients to understand it; not everyone is as technically versed and accepting the grim reality of the IT hellscape as you are (something tells me you've been through the helldesk… er… helpdesk at some point).

At the same time I've seen that the vast majority of our Akeeba Backup and Admin Tools clients are not using Scheduled Tasks. Those who do, bump into problems with the way Scheduled Tasks itself (has to realistically) work. For them, we have very limited advice. The vast majority of them figure out that it's far easier for them to just use CLI CRON jobs than go through yet another layer of abstraction which can quickly devolve to a layer of destruction if they are not extremely careful. The rest either soldier on, or blame us for Joomla's core code we have no control over. Well, not a great outcome no matter how you dice it.

With all that in mind, I don't see any added value as a business ownser to support Scheduled Tasks in ATS. On the contrary, I see a lot of pain by doing so, pain which is easily avoidable by not adding Scheduled Tasks support at all.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

[email protected]

Nicholas,

Thanks you for the taking time to provide such a detailed answer.

We will continue to use cron jobs vs. the Joomla Task Scheduler. 

Appreciate the advice!

Eric

 

 

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!