Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49070

Improve the site registration scheduled task

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      With an unregistered site go to the scheduled task page and check that \core\task\registration_cron_task is ready to be run. You can force this by running a query like this:
      update mdl_task_scheduled set nextruntime = 11111 where classname = '\core\task\registration_cron_task'

      Go to admin/cron.php and crtl+f for "Execute scheduled task: Site registration". It may not appear in the first cron run but make sure you don't miss it or you will need to re-alter the task_scheduled table.

      The output of the scheduled task should look something like this

      Execute scheduled task: Site registration
      ... started 08:05:38. Current memory use 22.9MB.
      Your site is not yet registered.
      ... used 3 dbqueries
      ... used 0.01972508430481 seconds
      Scheduled task complete: Site registration

      The presence of the "Your site is not registered" is the important part.

      Go back to the scheduled tasks page and check that the next run date for site registration has been moved into the future.

      Show
      With an unregistered site go to the scheduled task page and check that \core\task\registration_cron_task is ready to be run. You can force this by running a query like this: update mdl_task_scheduled set nextruntime = 11111 where classname = '\core\task\registration_cron_task' Go to admin/cron.php and crtl+f for "Execute scheduled task: Site registration". It may not appear in the first cron run but make sure you don't miss it or you will need to re-alter the task_scheduled table. The output of the scheduled task should look something like this Execute scheduled task: Site registration ... started 08:05:38. Current memory use 22.9MB. Your site is not yet registered. ... used 3 dbqueries ... used 0.01972508430481 seconds Scheduled task complete: Site registration The presence of the "Your site is not registered" is the important part. Go back to the scheduled tasks page and check that the next run date for site registration has been moved into the future.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-49070_scheduled

      Description

      A scheduled task exists in lib/classes/task/registration_cron_task.php. The code that actually does the work is in /admin/registration/lib.php cron().

      Its output if run on an unregistered site doesn't mention not being registered and probably should.

      Execute scheduled task: Site registration
      ... started 07:25:20. Current memory use 24.1MB.
      ... used 4 dbqueries
      ... used 0.060204029083252 seconds
      Scheduled task complete: Site registration

      The scheduled task, having run, is now set to run again tomorrow. Within the task there is code that silently does nothing if the task has been run within the last seven days. Imposing a hard limit on how often registration is updated seems fine but it would be nice if the scheduled task didn't pretend like it was updating the registration every day.

      Also, can the registration page determine if the scheduled task is enabled and output something to the UI? We don't need to tell users to manually update their registration if it will happen automatically. Also, if Moodle is "phoning home" we want to be very explicit about that.

        Attachments

          Activity

            People

            Assignee:
            andyjdavis Andrew Davis
            Reporter:
            andyjdavis Andrew Davis
            Peer reviewer:
            Ankit Agarwal
            Integrator:
            Dan Poltawski
            Tester:
            Damyon Wiese
            Participants:
            Component watchers:
            Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/15