Merge branch 'release/2.1.1'

This commit is contained in:
Ferdinand Kuhl 2022-05-16 12:04:40 +02:00
commit f0880cdf13

View file

@ -73,15 +73,15 @@ class SessionLockRequestComponent implements ComponentInterface
$this->logger->debug('SessionLock: Try to get "' . $key . '"'); $this->logger->debug('SessionLock: Try to get "' . $key . '"');
$timedOut = \time() + $this->secondsToWait; $timedOut = \time() + $this->secondsToWait;
while (!$lock->acquire() || $timedOut <= \time()) { while (!$lock->acquire()) {
\usleep(100000); \usleep(100000);
} if (\time() >= $timedOut) {
if (!$lock->isAcquired()) {
throw new LockAcquiringException( throw new LockAcquiringException(
'Could not acquire the lock for "' . $key . '" in ' . $this->secondsToWait . ' seconds.', 'Could not acquire the lock for "' . $key . '" in ' . $this->secondsToWait . ' seconds.',
1652687960 1652687960
); );
} }
}
$this->logger->debug('SessionLock: Acquired "' . $key . '"'); $this->logger->debug('SessionLock: Acquired "' . $key . '"');
} }
} }