Crons & Scheduled Tasks on Test and Development Sites

Crons & Scheduled Tasks on Test and Development Sites

by Blair F. -
Number of replies: 2
Picture of Particularly helpful Moodlers

This is an area that's a little more "under the hood" than I am used to on a day-to-day basis.

In addition to our production site, we have a test site (v 3.2) and a development site (v 3.4). On both of these sites, the cron run is turned off (probably to avoid sending out email messages to our students and faculty), but this makes it difficult to test certain functions that require the cron. If I understand correctly, if the cron doesn't run, than NOTHING on the scheduled tasks will run. So, I'm thinking that it would be better to allow the cron to run but use the Scheduled Tasks to turn off any events that we don't want to run (because they will send out notifications).  

For example, some of the events on our test server would be: 

  • \mod_attendance\task\notify
  • \core\task\calendar_cron_task
  • \core\task\send_failed_login_notifications_task
  • \mod_attendance\task\notify
  • \core\task\send_new_user_passwords_task
  • \mod_forum\task\cron_task

My questions are:

  1. is my thinking correct, or am I misunderstanding how things work?
  2. are there any obvious scheduled tasks from core that I have missed on my list?
  3. is there a better way of handling this?

Thanks for any enlightenment you can send my way.



Average of ratings: -
In reply to Blair F.

Re: Crons & Scheduled Tasks on Test and Development Sites

by Ken Task -
Picture of Particularly helpful Moodlers

Could add $CFG->noemailever = true; to config.php.

And run crons every minute as what is now recommended.   Disabling certain task that obviously involve EMail.

With that set, one area I know for sure you will have issues .... that of oauth2 and existing accounts linking as that requires a confirmation EMail.   Admin level user has no 'override' nor 'confirm' link in users listing via Moodle Admin UI.

'spirit of sharing', Ken

In reply to Ken Task

Re: Crons & Scheduled Tasks on Test and Development Sites

by Blair F. -
Picture of Particularly helpful Moodlers

Thanks for your reply and suggestions, Ken.

My level of access does not allow for editing of the config.php. I can only make changes that are part of the GUI.  I could ask our I.T. guy to do that, and may end up doing that, but I'd definitely prefer to use the Scheduled Tasks, if that's practical, so that I have control over it.

We don't use oauth2 (I had to google it to see what it was) or send any confirmation email, so I think we're OK with that.

Thanks, again, Ken.