From ea45965fb415d87e2d73179ed36386e3335a3a9e Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Mon, 8 Apr 2024 23:06:07 +0300 Subject: [PATCH] #61 Improved resilience by randomizing the processing of journals --- classes/tasks/Depositor.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/tasks/Depositor.inc.php b/classes/tasks/Depositor.inc.php index 0923605..52873a7 100644 --- a/classes/tasks/Depositor.inc.php +++ b/classes/tasks/Depositor.inc.php @@ -47,10 +47,11 @@ public function executeActions() { $journalDao = DAORegistry::getDAO('JournalDAO'); // Get all journals - $journals = $journalDao->getAll(true); + $journals = $journalDao->getAll(true)->toArray(); + shuffle($journals); // For all journals - while ($journal = $journals->next()) { + foreach ($journals as $journal) { // if the plugin isn't enabled for this journal, skip it if (!$this->_plugin->getSetting($journal->getId(), 'enabled')) {