Cron job is endlessly editing calendar in specific restored courses

Re: Cron job is endlessly editing calendar in specific restored courses

by Jon Marthaler -
Number of replies: 0
Want to update with a full(er) explanation of what is going on (at least, in my experience).

If you set a due date on an assignment, an event on the calendar was created - including the assignment description, even if "Always show description" was set to disabled. MDL-37509 was created and addressed to take care of this; the update was set to use the assign cron, with the following logic:

  • If "Always show description" is set to disabled, AND
  • Submissions for the assignment are allowed ("Allow submissions from" is a past date/time), AND
  • Submissions for the assignment are being allowed since the last time the assign cron ran, AND
  • The assignment has a due date set (and therefore an associated calendar event)
  • THEN update the calendar event to include the description.

Hence, thanks to the fix, the description for the assignment wouldn't show in the calendar until after submissions were open.

The problem was that a bug prevented checking the time of the last assign cron run. This meant that the cron was getting a list of all of the assignments with "Always show description" set to disabled, since the beginning of time up until now, and updating the events for their due dates. For every update, a log entry was recorded - which is why people saw this, especially in old courses that were imported.

I posted a simple fix on MDL-46539 - we deployed that today and it's working correctly. Hopefully this will be fixed in the next moodle.org release.

Hope this makes sense for anybody who's still looking for an explanation of what's going on...

Average of ratings: Useful (1)