Algolia_Algoliasearch_Model_Queue::runCron PHP Метод

runCron() публичный Метод

public runCron ( )
    public function runCron()
    {
        if (!$this->config->isQueueActive()) {
            return;
        }
        $nbJobs = $this->config->getNumberOfJobToRun();
        if (getenv('EMPTY_QUEUE') && getenv('EMPTY_QUEUE') == '1') {
            $nbJobs = -1;
        }
        $this->run($nbJobs);
    }

Usage Example

 /**
  * Rebuild all index data
  */
 public function reindexAll()
 {
     if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) {
         Mage::getSingleton('adminhtml/session')->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');
         return;
     }
     $this->queue->runCron();
     return $this;
 }