You are here

public function AcquiaPurgeService::lockAcquire in Acquia Purge 7

Retrieve permission to process the queue.

Return value

true|false TRUE when the lock is acquired, FALSE when the queue is locked.

File

lib/AcquiaPurgeService.php, line 344
Contains AcquiaPurgeService.

Class

AcquiaPurgeService
The Acquia Purge service.

Code

public function lockAcquire() {
  if ($this
    ->lockActive()) {
    return FALSE;
  }
  $this
    ->state()
    ->get('locked', FALSE)
    ->set(time());
  $this
    ->state()
    ->commit();
  return TRUE;
}