protected function FeedsSource::acquireLock in Feeds 7.2
Acquires a lock for this source.
Throws
FeedsLockException If a lock for the requested job could not be acquired.
4 calls to FeedsSource::acquireLock()
- FeedsSource::clear in includes/
FeedsSource.inc - Remove all items from a feed.
- FeedsSource::expire in includes/
FeedsSource.inc - Removes all expired items from a feed.
- FeedsSource::import in includes/
FeedsSource.inc - Import a source: execute fetching, parsing and processing stage.
- FeedsSource::pushImport in includes/
FeedsSource.inc - Imports a fetcher result all at once in memory.
File
- includes/
FeedsSource.inc, line 1222 - Definition of FeedsSourceInterface, FeedsState and FeedsSource class.
Class
- FeedsSource
- Holds the source of a feed to import.
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,
)));
}
// Switch account.
$this
->switchAccount();
}