You are here

protected function FeedsSource::acquireLock in Feeds 8.2

Acquires a lock for this source.

Throws

FeedsLockException If a lock for the requested job could not be acquired.

3 calls to FeedsSource::acquireLock()
FeedsSource::clear in lib/Drupal/feeds/FeedsSource.php
Remove all items from a feed.
FeedsSource::expire in lib/Drupal/feeds/FeedsSource.php
Removes all expired items from a feed.
FeedsSource::import in lib/Drupal/feeds/FeedsSource.php
Import a source: execute fetching, parsing and processing stage.

File

lib/Drupal/feeds/FeedsSource.php, line 649
Definition of FeedsSourceInterface and FeedsSource class.

Class

FeedsSource
This class encapsulates a source of a feed. It stores where the feed can be found and how to import it.

Namespace

Drupal\feeds

Code

protected function acquireLock() {
  if (!lock()
    ->acquire("feeds_source_{$this->id}_{$this->feed_nid}", 60.0)) {
    throw new FeedsLockException(t('Cannot acquire lock for source @id / @feed_nid.', array(
      '@id' => $this->id,
      '@feed_nid' => $this->feed_nid,
    )));
  }
}