Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MongoDbStore.php

function MongoDbStore::putOffExpiration

Throws

LockStorageException

LockExpiredException

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\Store

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal