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
$container->setDefinition($legacyStoreDefinitionId = 'lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $legacyStoreDefinition)->setDeprecated(true, 'The "%service_id%" service is deprecated.');
$container->registerAliasForArgument('lock.'.$resourceName.'.store', StoreInterface::class, $resourceName.'.lock.store')->setDeprecated(true, 'The "%alias_id%" service is deprecated.');
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.4 and has been splitted into "%s", "%s", "%s".', StoreInterface::class, PersistStoreInterface::class, ExpiringStoreInterface::class, BlockingStoreInterface::class), E_USER_DEPRECATED);
48
+
}
49
+
50
+
if (!($storeinstanceof PersistStoreInterface || $storeinstanceof StoreInterface)) {
51
+
thrownewInvalidArgumentException(sprintf('$store should implement %s.', PersistStoreInterface::class));
52
+
}
53
+
46
54
$this->store = $store;
47
55
$this->key = $key;
48
56
$this->ttl = $ttl;
@@ -69,7 +77,7 @@ public function __destruct()
69
77
publicfunctionacquire($blocking = false)
70
78
{
71
79
try {
72
-
if ($blocking) {
80
+
if ($blocking && $this->storeinstanceof BlockingStoreInterface && $this->store->supportsWaitAndSave()) {
73
81
$this->store->waitAndSave($this->key);
74
82
} else {
75
83
$this->store->save($this->key);
@@ -121,7 +129,9 @@ public function refresh($ttl = null)
121
129
122
130
try {
123
131
$this->key->resetLifetime();
124
-
$this->store->putOffExpiration($this->key, $ttl);
132
+
if ($this->storeinstanceof ExpiringStoreInterface && $this->store->supportsPutOffExpiration()) {
0 commit comments