*/
protected $cache = [];
- /**
- * list of editors for outstanding cronjobs
- * @var CronjobEditor[]
- */
- protected $cronjobEditors = [];
-
/**
* @inheritDoc
*/
$this->resetFailedCronjobs();
// get outstanding cronjobs
- $this->loadCronjobs();
+ $cronjobEditors = $this->loadCronjobs();
// clear cache
self::clearCache();
- foreach ($this->cronjobEditors as $cronjobEditor) {
+ foreach ($cronjobEditors as $cronjobEditor) {
// mark cronjob as being executed
$cronjobEditor->update([
'state' => Cronjob::EXECUTING
Cronjob::READY,
TIME_NOW
]);
+
+ $cronjobEditors = [];
/** @var Cronjob $cronjob */
while ($cronjob = $statement->fetchObject(Cronjob::class)) {
$cronjobEditor = new CronjobEditor($cronjob);
$cronjobEditor->update($data);
- $this->cronjobEditors[] = $cronjobEditor;
+ $cronjobEditors[] = $cronjobEditor;
}
WCF::getDB()->commitTransaction();
$committed = true;
+
+ return $cronjobEditors;
}
finally {
if (!$committed) {
WCF::getDB()->rollBackTransaction();
- $this->cronjobEditors = [];
}
}
}