You are here

function drush_acquia_contenthub_watchdog_queue_sizes in Acquia Content Hub 8

Log size of our queues to Drupal watchdog.

File

./acquia_contenthub.drush.inc, line 1056
ContentHub Drush Commands.

Code

function drush_acquia_contenthub_watchdog_queue_sizes() {
  $queue = drush_queue_get_class();
  $sizes = '';
  foreach ([
    'acquia_contenthub_export_queue',
    'acquia_contenthub_import_queue',
  ] as $name) {
    $sizes .= $name . '=' . $queue
      ->getQueue($name)
      ->numberOfItems() . ";";
  }
  $logger = \Drupal::getContainer()
    ->get('logger.factory');
  $logger
    ->get('acquia_contenthub')
    ->debug('Content Hub queues size tracking: %sizes', [
    '%sizes' => $sizes,
  ]);
}