From 9913b3c61ccd5cb9ea04ebcdc969a2342a6d4bc3 Mon Sep 17 00:00:00 2001 From: Igor Manjencic Date: Fri, 15 Dec 2023 10:15:08 +0100 Subject: [PATCH] fix(ZMS-1710): fix deadlock --- zmsdb/src/Zmsdb/Connection/Select.php | 5 +++++ zmsdb/src/Zmsdb/Helper/CalculateSlots.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/zmsdb/src/Zmsdb/Connection/Select.php b/zmsdb/src/Zmsdb/Connection/Select.php index 35d931e4f..a494b5397 100644 --- a/zmsdb/src/Zmsdb/Connection/Select.php +++ b/zmsdb/src/Zmsdb/Connection/Select.php @@ -323,4 +323,9 @@ public static function writeCommit() } return null; } + + public static function writeCommitWithStartLock() + { + return self::writeCommit() && (new \BO\Zmsdb\Config)->readProperty('status__calculateSlotsLastRun', true); + } } diff --git a/zmsdb/src/Zmsdb/Helper/CalculateSlots.php b/zmsdb/src/Zmsdb/Helper/CalculateSlots.php index 097b5ab5b..ca2a095d1 100644 --- a/zmsdb/src/Zmsdb/Helper/CalculateSlots.php +++ b/zmsdb/src/Zmsdb/Helper/CalculateSlots.php @@ -144,7 +144,7 @@ protected function writeCalculatedScope(\BO\Zmsentities\Scope $scope, \DateTimeI } if (count($updatedList)) { $this->writePostProcessingByScope($scope, $now); - \BO\Zmsdb\Connection\Select::writeCommit(); + \BO\Zmsdb\Connection\Select::writeCommitWithStartLock(); $this->readLastRun(); return true; }