MDL-51707 cron: Prevent finished tasks being returned
authorMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 8 Oct 2015 13:39:27 +0000 (14:39 +0100)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 8 Oct 2015 13:43:56 +0000 (14:43 +0100)
lib/classes/task/manager.php

index 24852e1..a06a451 100644 (file)
@@ -491,6 +491,12 @@ class manager {
                     }
                 }
 
+                // Make sure the task data is unchanged.
+                if (!$DB->record_exists('task_scheduled', (array) $record)) {
+                    $lock->release();
+                    continue;
+                }
+
                 if (!$task->is_blocking()) {
                     $cronlock->release();
                 } else {