You are here

protected function AcquiaPurgeProcessorBase::processQueueChunk in Acquia Purge 7

Attempt to process a chunk from the queue.

Parameters

bool $log: (optional) Whether diagnostic failure should be logged or not.

2 calls to AcquiaPurgeProcessorBase::processQueueChunk()
AcquiaPurgeProcessorCron::onCron in lib/processor/AcquiaPurgeProcessorCron.php
Implements event onCron.
AcquiaPurgeProcessorRuntime::processQueueChunk in lib/processor/AcquiaPurgeProcessorRuntime.php
Attempt to process a chunk from the queue.
1 method overrides AcquiaPurgeProcessorBase::processQueueChunk()
AcquiaPurgeProcessorRuntime::processQueueChunk in lib/processor/AcquiaPurgeProcessorRuntime.php
Attempt to process a chunk from the queue.

File

lib/processor/AcquiaPurgeProcessorBase.php, line 36
Contains AcquiaPurgeProcessorBase.

Class

AcquiaPurgeProcessorBase
Base class for processors that process items from the queue.

Code

protected function processQueueChunk($log = TRUE) {

  // Test if the diagnostic tests prohibit purging the queue.
  if ($err = $this->service
    ->diagnostics()
    ->isSystemBlocked()) {
    if ($log) {
      $this->service
        ->diagnostics()
        ->log($err);
    }
    return;
  }

  // Acquire a lock and process a chunk from the queue.
  if ($this->service
    ->lockAcquire()) {
    $this->service
      ->process();
    $this->service
      ->lockRelease();
  }
}