You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Enforcement of Lock\Key expiry is handled both by all of the Lock\Store\* as well as Lock\Lock. In the interest of DRY and maintaining consistent behavior, we should move enforcement to exist in Lock\Lock only.
Example
diff --git a/src/Symfony/Component/Lock/Store/MemcachedStore.php b/src/Symfony/Component/Lock/Store/MemcachedStore.php
index c9200af199..dd92024288 100644
--- a/src/Symfony/Component/Lock/Store/MemcachedStore.php+++ b/src/Symfony/Component/Lock/Store/MemcachedStore.php@@ -63,10 +63,6 @@ class MemcachedStore implements StoreInterface
// the lock is already acquired. It could be us. Let's try to put off.
$this->putOffExpiration($key, $this->initialTtl);
}
-- if ($key->isExpired()) {- throw new LockExpiredException(sprintf('Failed to store the "%s" lock.', $key));- }
}
public function waitAndSave(Key $key)
@@ -109,10 +105,6 @@ class MemcachedStore implements StoreInterface
if (!$this->memcached->cas($cas, (string) $key, $token, $ttl)) {
throw new LockConflictedException();
}
-- if ($key->isExpired()) {- throw new LockExpiredException(sprintf('Failed to put off the expiration of the "%s" lock within the specified time.', $key));- }
}
/**
Please See Lock\Lock::acquire and Lock\Lock::refresh:
if ($this->key->isExpired()) {
thrownewLockExpiredException(sprintf('Failed to store the "%s" lock.', $this->key));
}
if ($this->key->isExpired()) {
thrownewLockExpiredException(sprintf('Failed to put off the expiration of the "%s" lock within the specified time.', $this->key));
}
The text was updated successfully, but these errors were encountered:
Description
Enforcement of
Lock\Key
expiry is handled both by all of theLock\Store\*
as well asLock\Lock
. In the interest of DRY and maintaining consistent behavior, we should move enforcement to exist inLock\Lock
only.Example
Please See
Lock\Lock::acquire
andLock\Lock::refresh
:The text was updated successfully, but these errors were encountered: