From 45862cd2ee4646d789d118b5c8928a0226b1181c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Manjen=C4=8Di=C4=87?= Date: Mon, 4 Dec 2023 18:18:04 +0100 Subject: [PATCH 1/2] feat(ZMS-1223): fix cron --- zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php index 68209d52d..fe48db9f6 100644 --- a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php +++ b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php @@ -89,7 +89,7 @@ protected function writeProcessInStatisticTable( ) { $requestList = (new \BO\Zmsdb\Request())->readRequestByArchiveId($process->archiveId); $requestList = ($requestList->count()) ? $requestList : [new \BO\Zmsentities\Request(['id' => '-1'])]; - $processingTime = $requestList->count() === 1 ? $process->bearbeitungszeit : null; + $processingTime = ($requestList->count() && $requestList->count() === 1) ? $process->bearbeitungszeit : null; foreach ($requestList as $request) { $archived = true; // for verbose From d95446fe567b5109178a87065d2ab02ee7d692c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Manjen=C4=8Di=C4=87?= Date: Mon, 4 Dec 2023 18:22:19 +0100 Subject: [PATCH 2/2] feat(ZMS-1223): fix cron --- .../src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php index fe48db9f6..b64460931 100644 --- a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php +++ b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php @@ -88,8 +88,12 @@ protected function writeProcessInStatisticTable( $commit = false ) { $requestList = (new \BO\Zmsdb\Request())->readRequestByArchiveId($process->archiveId); - $requestList = ($requestList->count()) ? $requestList : [new \BO\Zmsentities\Request(['id' => '-1'])]; - $processingTime = ($requestList->count() && $requestList->count() === 1) ? $process->bearbeitungszeit : null; + $processingTime = null; + if ($requestList->count()) { + $processingTime = $requestList->count() === 1 ? $process->bearbeitungszeit : null; + } else { + $requestList = [new \BO\Zmsentities\Request(['id' => '-1'])]; + } foreach ($requestList as $request) { $archived = true; // for verbose