function MongoDbStore::putOffExpiration
Throws
Overrides PersistingStoreInterface::putOffExpiration
File
-
vendor/
symfony/ lock/ Store/ MongoDbStore.php, line 246
Class
- MongoDbStore
- MongoDbStore is a StoreInterface implementation using MongoDB as a storage engine. Support for MongoDB server >=2.2 due to use of TTL indexes.
Namespace
Symfony\Component\Lock\StoreCode
public function putOffExpiration(Key $key, float $ttl) : void {
$key->reduceLifetime($ttl);
try {
$this->upsert($key, $ttl);
} catch (BulkWriteException $e) {
if ($this->isDuplicateKeyException($e)) {
throw new LockConflictedException('Failed to put off the expiration of the lock.', 0, $e);
}
throw new LockStorageException($e->getMessage(), 0, $e);
}
$this->checkNotExpired($key);
}