public function PushQueue::garbageCollection in Salesforce Suite 8.3
Same name and namespace in other branches
- 8.4 modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::garbageCollection()
- 5.0.x modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::garbageCollection()
Cleans queues of garbage.
Overrides DatabaseQueue::garbageCollection
1 call to PushQueue::garbageCollection()
- PushQueue::processQueue in modules/
salesforce_push/ src/ PushQueue.php - Given a salesforce mapping, process all its push queue entries.
File
- modules/
salesforce_push/ src/ PushQueue.php, line 601
Class
- PushQueue
- Salesforce push queue.
Namespace
Drupal\salesforce_pushCode
public function garbageCollection() {
if ($this->garbageCollected) {
// Prevent excessive garbage collection. We only need it once per request.
return;
}
try {
// Reset expired items in the default queue implementation table. If
// that's not used, this will simply be a no-op.
$this->connection
->update(static::TABLE_NAME)
->fields([
'expire' => 0,
])
->condition('expire', 0, '<>')
->condition('expire', REQUEST_TIME, '<')
->execute();
$this->garbageCollected = TRUE;
} catch (\Exception $e) {
$this
->catchException($e);
}
}