Skip to content

Commit

Permalink
Added warning if queue factory is not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
kepol committed Nov 3, 2023
1 parent 8b77f79 commit bae81d1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions quant.module
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@
*/

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Session\AccountInterface;
use Drupal\node\NodeInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
use Drupal\node\NodeInterface;
use Drupal\quant\Exception\TokenValidationDisabledException;
use Drupal\quant\Plugin\QueueItem\RouteItem;
use Drupal\quant\Seed;
use Drupal\quant\QuantQueueFactory;
use Drupal\quant\Seed;

/**
* Implements hook_preprocess_page().
*/
function quant_preprocess_page(&$variables) {

// Add warning on Quant admin pages if queue factory is not set.
$current_path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo();
if ((strpos($current_path, '/admin/config/quant') === 0) && Settings::get('queue_service_quant_seed_worker') != "quant.queue_factory") {
\Drupal::messenger()->addWarning(t("For the best performance, it is highly recommended you update <em>queue_service_quant_seed_worker</em> in your settings. See the <a href=\"https://docs.quantcdn.io/docs/integrations/drupal">Drupal docs</a> for setup information."));
}
}

/**
* Implements hook_menu_local_tasks_alter().
Expand Down

0 comments on commit bae81d1

Please sign in to comment.