function advancedqueue_cron in Advanced Queue 8
Same name and namespace in other branches
- 7 advancedqueue.module \advancedqueue_cron()
Implements hook_cron().
File
- ./
advancedqueue.module, line 13 - Provides a better queue API.
Code
function advancedqueue_cron() {
$queue_processor = \Drupal::service('advancedqueue.processor');
$queue_storage = \Drupal::entityTypeManager()
->getStorage('advancedqueue_queue');
/** @var \Drupal\advancedqueue\Entity\QueueInterface[] $queues */
$queues = $queue_storage
->loadByProperties([
'processor' => QueueInterface::PROCESSOR_CRON,
]);
foreach ($queues as $queue) {
$queue_processor
->processQueue($queue);
}
}