Moodle

Use timestamp to determine how often clean up tasks run in cron.php instead of random number

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Unknown
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

I was pulling my hair out trying to figure out why my unconfirmed users were not getting deleted when the cron ran.

I finally came across the random generator in cron.php and realized that the bottom half of the cron only gets run sometimes!!!

I think this should be changed so you can set it up to run those clean up tasks at a specific interval relative to the cron job that gets called.

For example, need options something like this:
Run clean up tasks EVERY time cron.php is run.
Run clean up tasks 2nd time cron.php is run.
Run clean up tasks 5th time cron.php is run.
Run clean up tasks 10th time cron.php is run.
Run clean up tasks 15th time cron.php is run.
Run clean up tasks 20th time cron.php is run.
Run clean up tasks 25th time cron.php is run.
etc...

This seems a little more controllable than a random number!!

Personally, my Moodle cron only runs once every 24 hours, so relying on a 20% chance that my unconfirmed users might get deleted is not acceptable. They MUST be deleted everyday, and a random number does not guarantee that.

Thanks

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: