Skip to content
Snippets Groups Projects
Commit 7d0bea6b authored by Alexander Rhodes's avatar Alexander Rhodes
Browse files

Adds early exit to processQueue if the queue table doesn't exist

parent 63ec11f9
No related branches found
No related tags found
No related merge requests found
...@@ -341,21 +341,26 @@ class PushQueue extends DatabaseQueue implements PushQueueInterface { ...@@ -341,21 +341,26 @@ class PushQueue extends DatabaseQueue implements PushQueueInterface {
return $this; return $this;
} }
/** /**
* Given a salesforce mapping, process all its push queue entries. * Given a salesforce mapping, process all its push queue entries.
* *
* @param SalesforceMapping $mapping * @param \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping
* Salesforce mapping.
* *
* @return int * @return int
* The number of items procesed, or -1 if there was any error, And also * The number of items procesed, or -1 if there was any error, And also
* dispatches a SalesforceEvents::ERROR event. * dispatches a SalesforceEvents::ERROR event.
*/ */
public function processQueue(SalesforceMappingInterface $mapping) { public function processQueue(SalesforceMappingInterface $mapping) {
if (!$this->connection->schema()->tableExists(static::TABLE_NAME)) {
return 0;
}
$this->garbageCollection(); $this->garbageCollection();
static $queue_processor = FALSE; static $queue_processor = FALSE;
// Check mapping frequency before proceeding. // Check mapping frequency before proceeding.
if ($mapping->getNextPushTime() > $this->time->getRequestTime()) { if ($mapping->getNextPushTime() > $this->time->getRequestTime()) {
return; return 0;
} }
if (!$queue_processor) { if (!$queue_processor) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment