Questions tagged [queue]

Use it for the Drupal API that provides a means for storing items into a processing queue.

Filter by
Sorted by
Tagged with
32 votes
5 answers
16k views

Do I need a cron task for processing a queue?

I've got a task that takes about 45 minutes to complete and needs to happen every day (synching users to several external database, etc). To handle the work, I've set up a cron queue with ...
  • 664
12 votes
4 answers
19k views

How do I clear or delete a queue?

I scheduled a big queue with VBO, but I changed my mind. How can I delete it? I don't seem to find any UI/interface to manage queues. Do I have to delete it in the database?
  • 4,587
7 votes
1 answer
242 views

Automated Drupal issue queue workflow

Working in the issue queue on any busy project can be quite a bit of work. Lots of files (patches) to manage, interdiffs, and ideally a branch for piece of work, moving patches forward with rebase ...
  • 27.5k
6 votes
2 answers
7k views

Running a queue worker without using cron tasks

I implemented hook_queue_info() with the following code. function ecc_general_queue_info() { $queues = array(); $queues['adding_checklist'] = array( 'worker callback' => '...
  • 195
5 votes
2 answers
347 views

Trade-offs between Job Queue vs. Drupal Queue

Anyone familiar with both Job Queue and Drupal Queue enough to offer an idea of the tradeoffs between the two? In case it makes a difference, the site I'm working on uses Drupal 6. The queue I'll be ...
  • 3,004
5 votes
2 answers
237 views

How can I run the inbuilt Drush 10.x commands as user #1?

I have a Drupal Queue worker class that fetches the Entity objects from Drupal to index to Elasticsearch. The following command is causing the lesser documents to show up in Elasticsearch since by ...
  • 2,476
4 votes
3 answers
1k views

hook_cron_queue_info 'time' value

I've been searching around, but I can not find a good explanation (or understanding) what the 'time' value in hook_cron_queue_info actually does, or how to set it to work properly. From: https://api....
4 votes
2 answers
2k views

How to process more than one item from queue in each run?

I have set up a queue using this code. function custom_logger_cron_queue_info() { $queues['custom_logger'] = array( 'worker callback' => 'custom_logger_import', 'time' => 60, ); ...
  • 3,037
4 votes
1 answer
3k views

Drupal queue / update module

I have a Drupal 7 site and the queue table has over 4K records. They are primarily for the "update_fetch_tasks" queue. Is the queue table by nature a temporary place holder? I would like to clean it ...
  • 1,440
4 votes
4 answers
565 views

Drupal queue task sequencing

Is there a way to use Drupal Queue API to sequence the execution of tasks, like in a pipeline? My use case is pretty simple: I have a number of tasks executing in the background, doesn't matter their ...
4 votes
1 answer
2k views

How to run a cron queue programmatically?

I have created a cron queue like given below. function mymodule_cron_queue_info() { $queues['aggregator_feeds'] = array( 'worker callback' => 'aggregator_refresh', 'time' => 60, ); ...
4 votes
2 answers
3k views

Get cron to process QueueWorker items at a specific time

I have a Plugin\QueueWorker that creates a queue of emails to send from nodes that are created/updated throughout the day. I've defined a processItem() method, as well as an arbitrary function (let's ...
4 votes
0 answers
885 views

Using multiple keys on multi row db_merge?

I am using db_merge (mysql) for getting jobs into my queues. I therefore have each task only once (the job is quite intensive and many things can trigger the task to be queued, so want to avoid ...
  • 413
3 votes
4 answers
7k views

How to check if an item exists in a Queue?

While inserting items in a Queue how can I check if the item I am trying to insert is already present in the Queue?
3 votes
1 answer
76 views

How to detect insertion of new item(s) into Drupal's queue?

I need to trigger some code when new items are added to Drupal's queue system. My question, how to do that? How to capture that event? Further details I have created a custom views bulk operation ...
  • 726
3 votes
2 answers
890 views

Is it possible to create a Nodequeue of Nodequeues?

I have a number of node queues that serve as collections of nodes. I want the user to be able to take those collections (node queues) and add them to a queue, essentially allowing the user to have a ...
  • 2,510
3 votes
1 answer
761 views

Running triggered rules actions in the background?

I am using triggered rules to set off potentially lengthy actions on nodes, e.g. automatic node translation using Google Translate. Running those actions during the node creation page request slows ...
3 votes
1 answer
542 views

Sorting a view on a taxonomy term with entityqueue

I'm trying to use an entity queue on a taxonomy to create a new sort order for an existing view. But I'm having trouble configuring it. I've created a dummy website with a fantasy role-playing game ...
  • 3,879
3 votes
1 answer
89 views

How to troubleshoot my VBO operation which freezes at 50% every time?

I have written custom code that creates a new action for Views Bulk Operations (VBO). I am trying to run the action and it gets stuck at "Prepared 46748 out of 46766". If I run the same action with ...
  • 175
3 votes
0 answers
883 views

My queue table is huge, is it safe to empty it? [duplicate]

I have launched some batch jobs that I didn't finish. Now I notice my queue table is almost 1 GB. Is it safe to empty it?
  • 4,587
2 votes
3 answers
4k views

When should I "send mail by queue" with the SMTP module?

On the SMTP module configuration page at /admin/config/system/smtp, it offers the option to Send mail by queue (Mails will be sent by drupal queue api.). When would I want to check this box? What ...
2 votes
1 answer
991 views

Add items to batch queue operations on the fly

I have some code which generates a batch with a single operation; to go off to an API and get some data. This data could be any number of items. I would like to be able to populate the rest of the ...
  • 244
2 votes
4 answers
2k views

How to prevent adding of duplicate item to Drupal Queue?

I am using Drupal Queue (Class DrupalQueue) to store items (a simple objects). How can I check if there is already the same object in the queue before adding a new one ?
2 votes
1 answer
213 views

DrupalQueue worker callback in separate file

This is my first time using the DrupalQueue class, and I have two questions. Does hook_cron_queue_info() HAVE to go in my mymodule.module file? I had some weird behavior before finally trying that, ...
2 votes
1 answer
644 views

What does it mean if an item in Search API has a "-1" flag and is never indexed?

Search API uses flags in the changed column of the search_api_item table to store item-level information relating to indexing. The -1 flag (something to do with queuing items?) appears to be crucial ...
2 votes
1 answer
68 views

How to resave all user accounts on a schedule?

I want to re-save all user accounts on my site weekly because I wrote some code in hook_user_presave() that I want to update every week. Specifically, my hook_user_presave() code updates the values of ...
2 votes
1 answer
537 views

How do I create a derivative?

I would like to create a queue derivative, where I can use a single QueueWorker class to process multiple queues, but I am not able to achieve it. Any help would be greatly appreciated. The module ...
2 votes
1 answer
408 views

Exception in worker callback prevents queue item from being removed

I have created a Drupal 7 module that utilizes hook_cron() and hook_cron_queue_info() to process some data, as well as use the module Ultimate Cron to handle scheduling when each runs. hook_cron() is ...
2 votes
1 answer
797 views

Queue doesn't enter on worker function with Elysia cron

I'm trying to use queue api with cron, everything seems work but drupal does not enter on the "worker" function. The problem there is only if I enable Elysia Cron (and I've to enable it..) <?php ...
  • 3,132
2 votes
0 answers
61 views

Variations created with a queue worker sluggishly slow

The site my team is currently building is meant to import a list of all available trips for a travel booking agency. The method we settled for (for now) can be summarized as such : A daily cron job ...
2 votes
0 answers
729 views

How can I have a single QueueWorker run on cron for multiple Queues?

I have a site in which I associate multiple Config Entities with a single Queue ie. example_queue (using the default QueueInterface). My Config Entities produce records that are processed as queue ...
  • 1,565
2 votes
0 answers
161 views

How to schedule content every Wednesday at 18.00 (6 PM)?

Looking for something which was easy in Drupal 7, but can't find it or can't get it to work in Drupal 8. import feed do not publish content immediately run a rule that sets the content to publish ...
  • 23
2 votes
2 answers
1k views

Loading a queue?

How can I use Drush to pass data into a Drupal Queue? function hook_cron_queue_info() { $queues['my_queue_name'] = array( 'worker callback' => '_my_queue_callback', // This is the callback ...
  • 7,884
1 vote
2 answers
499 views

Improve performance by using drush functions instead of Drupal module functions

I am trying to improve the import performance of a drupal website we are working on. The site makes use of the queue api to import individual items. Currently this process is very slow. I have hear ...
  • 879
1 vote
2 answers
2k views

Drupal queue processing at cron run

I use ultimate cron to fill in a queue with some nids. To add the items in the queue, I use something like: $queue = DrupalQueue::get('my_queue'); foreach($urls as $nid=>$url){ sleep(1); $...
  • 1,261
1 vote
2 answers
2k views

Auto add nodes on save to a queue using entityqueue

I am using entity queue module, Created a queue with a name ABC. I want to add nodes automatically to this queue for a specific content type while creating new nodes. Is there a way to do this?
  • 2,765
1 vote
1 answer
383 views

hook_cron_queue_info doesn't run [closed]

I am using hook_cron in my module to create a queue. The queue will process a couple of non-drupal database tables and synch some data around (a process that can take close to 10 minutes). I'm ...
  • 553
1 vote
1 answer
245 views

Job queue – dealing with stuck records

I have a cron job that gets stuck because I have a loop claiming items from the queue that ends on numberOfItems() == 0, which never happens because one of the queue items is stuck and cannot be ...
  • 400
1 vote
1 answer
54 views

Test a settings form that displays a queue

I'm trying to write a test on a settings form. The module uses a queue, and the settings form displays the items in the queue like so: When I extend the test class from WebTestBase I get: Drupal\...
  • 285
1 vote
1 answer
416 views

Send the email when specific node is created

In one of my module, i have created a checkbox on user account page. If user has checked that checkbox at that time an email is sent to all the user when any specific node is created. Lets say when ...
  • 3,956
1 vote
1 answer
222 views

drupal_queues for drupal 6

So this all starts when I hit my php memory limit, I know I can increase my php memory limit... but in order to get the process that I needed running I had to up my limit to 1026M... and I dont think ...
  • 238
1 vote
0 answers
82 views

Queue API - Run a function after a queue has finished?

I have created a custom queue that imports entities from an external api. During each queue item process I want to save the id of the created/updated entity, and at the end of the queue I want to use ...
  • 517
1 vote
1 answer
287 views

Abstract Base Class versus Service with Queue API

I'm trying to figure out the best way to structure a custom module that uses the Queue API in D8. I'm new to D8 and a bit rusty with OOP so forgive me if I'm breaking some recommended design pattern ...
  • 539
1 vote
0 answers
66 views

How should I use the Queue Runner module?

I would like to run tasks in sequence (commerce product feed before commerce node feed). I think the Queue Runner module could do the job. However, I can't find sufficient examples of how to implement ...
  • 11
1 vote
0 answers
703 views

Drupal Queue is not processing with hook cron

All my code is here, the queues are created in backoffice, but the action in the worker call back is never processed. ! I lean the node creation in my function inalco_publications_queue_worker is ...
  • 288
0 votes
3 answers
2k views

How to manage / consume multiple Queue API queues in a module?

For a site I'm running, I'm going to have a few different queues for message sending. For example: high priority email, low priority email, high priority twitter, low priority twitter... etc. I have ...
  • 5,463
0 votes
2 answers
2k views

Cron queue not working

I'm trying to set up a cron queue, but for some reason, I don't manage to get this done. Here is what I have so far: function mymodule_cron() { // Setup the queue $queue = DrupalQueue::get('...
  • 1,567
0 votes
1 answer
175 views

How to get the base URL of a site in Queue API?

I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here? public function testUrl() { global $base_url; ...
0 votes
2 answers
1k views

How to process single queue item using QueueWorker on cron runs?

For each cron run, I would like to be able to process only 1 item in my queue using QueueWorker. At the moment it seems to me that Drupal keep processing items until it reaches the time parameter for ...
  • 2,359
0 votes
1 answer
439 views

Using Drupal Queue

I think I am close to getting a queue to work with the Drupal 7 Queue API. I have some code that returns a value to me that I want to retrieve on cron. function ...{ $guid_to_enqueue = $guid; /...
  • 175