From 24283b795f4123445759b22d456e2815c2b67285 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Mon, 16 May 2022 12:08:39 +0200 Subject: [PATCH] Check first, then wait --- Classes/Http/SessionLockRequestComponent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Http/SessionLockRequestComponent.php b/Classes/Http/SessionLockRequestComponent.php index 1a0b546..43109ad 100644 --- a/Classes/Http/SessionLockRequestComponent.php +++ b/Classes/Http/SessionLockRequestComponent.php @@ -74,13 +74,13 @@ class SessionLockRequestComponent implements ComponentInterface $this->logger->debug('SessionLock: Try to get "' . $key . '"'); $timedOut = \time() + $this->secondsToWait; while (!$lock->acquire()) { - \usleep(100000); if (\time() >= $timedOut) { throw new LockAcquiringException( 'Could not acquire the lock for "' . $key . '" in ' . $this->secondsToWait . ' seconds.', 1652687960 ); } + \usleep(100000); } $this->logger->debug('SessionLock: Acquired "' . $key . '"'); }