A few remaining legacy cron tasks in core

A few remaining legacy cron tasks in core

by sam marshall -
Number of replies: 5
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

I was checking if we had any remaining local plugins that still use the legacy cron rather than the more recent tasks system (we do! but only one), and I noticed the following core plugins that still use legacy cron. (This is an extract from cron logs  and is probably a partial list - it's very likely I am missing plugins which are turned off on OU systems.)

Processing module function quiz_cron ...
Processing module function assign_cron ...
Processing module function workshop_cron ...
Processing cron function for workshopallocation_scheduled...
Processing module function scorm_cron ...
Processing cron function for repository_dropbox...
Processing cron function for repository_filesystem...
Running cron for enrol_manual...
Running cron for enrol_meta...

Just posting the list in case it might be useful - I'm basically wondering if anybody is planning to convert the remaining core ones. We don't have time here. But there aren't that many left and even if HQ aren't doing it, it seems like it might be a reasonably easy task for a non-HQ developer to get some experience with... smile [I mean, doing one or two, not all of them at once.] Actually doing it is easy, so it's more about testing that it still works etc.

Not very important but it's a small area of technical debt, and if all the legacy cron things were removed from core then it would be possible to eventually remove the old system (perhaps initially by changing the default task schedule to disabled, rather than getting rid of it entirely).

--sam

Average of ratings: Useful (1)
In reply to sam marshall

Re: A few remaining legacy cron tasks in core

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Some others are:

  • calendar
  • enrol_category
  • enrol_imsenterprise
  • enrol_paypal
  • enrol_self
  • mod_forum
  • mod_wiki
In reply to Michael Aherne

Re: A few remaining legacy cron tasks in core

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

I think forum may have been converted. For a very loose definition of 'converted'! There is a task definition, but it then calls the old forum_cron function! I assume the task takes precedence in this case, but haven't actually checked...

Some of the enrol plugins look like they've been converted too (I spot checked one). The calendar hjas been converted.

Agree about wiki!

--sam

In reply to sam marshall

Re: A few remaining legacy cron tasks in core

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Sorry, I was counting ones where the cron function still exists but missed the fact that some have scheduled tasks that call it!

In reply to sam marshall

Re: A few remaining legacy cron tasks in core

by Dan Poltawski -

Give i'm responsible for cae945d2 - i'll clarify that yes, the removal of the $plugin->cron does the trick.

In reply to sam marshall

Re: A few remaining legacy cron tasks in core

by Dan Poltawski -

I don't think anyone in HQ is working on this.

Regarding deprecating the old cron system  MDL-52846 was created for that. (Spoiler: we might never do it).