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
17k 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 ...
joe_flash's user avatar
  • 664
12 votes
4 answers
20k 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?
giorgio79's user avatar
  • 4,597
7 votes
2 answers
8k 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' => '...
Mohandes's user avatar
  • 215
7 votes
3 answers
494 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 ...
Sivaji's user avatar
  • 2,466
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 ...
Letharion's user avatar
  • 27.5k
5 votes
2 answers
348 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 ...
Matt V.'s user avatar
  • 2,994
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....
Quentin Campbell's user avatar
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, ); ...
7wonders's user avatar
  • 3,047
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 ...
Jepedo's user avatar
  • 1,450
4 votes
4 answers
569 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 ...
infojunkie's user avatar
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, ); ...
Mirza V U's user avatar
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 ...
Matt Fletcher's user avatar
4 votes
0 answers
931 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 ...
Paul's user avatar
  • 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?
Malabya Tewari's user avatar
3 votes
5 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 ?
Michal Przybylowicz's user avatar
3 votes
1 answer
88 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 ...
W.M.'s user avatar
  • 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 ...
user379468's user avatar
  • 2,520
3 votes
1 answer
762 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 ...
infojunkie's user avatar
3 votes
1 answer
652 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 ...
user1359's user avatar
  • 3,909
3 votes
1 answer
94 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 ...
Josh's user avatar
  • 195
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?
giorgio79's user avatar
  • 4,597
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 ...
Patrick Kenny's user avatar
2 votes
1 answer
1k 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 ...
Nick's user avatar
  • 254
2 votes
1 answer
232 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, ...
UnsettlingTrend's user avatar
2 votes
1 answer
124 views

getPluginDefinition custom QueueWorker empty after upgrade

I've got a custom queue worker that used to work fine in Drupal 9, but stopped working after the upgrade to Drupal 10. I've narrowed it down to the getPluginDefinition method not returning anything. ...
Menno van den Heuvel's user avatar
2 votes
1 answer
649 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 ...
user56reinstatemonica8's user avatar
2 votes
1 answer
74 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 ...
Patrick Kenny's user avatar
2 votes
1 answer
686 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 ...
miststudent2011's user avatar
2 votes
1 answer
438 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 ...
CodeWatson's user avatar
2 votes
1 answer
814 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 ...
arrubiu's user avatar
  • 3,212
2 votes
0 answers
70 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 ...
BigChing's user avatar
2 votes
0 answers
968 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 ...
baikho's user avatar
  • 1,727
2 votes
0 answers
171 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 ...
mchvdm's user avatar
  • 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 ...
Citricguy's user avatar
  • 7,904
1 vote
1 answer
243 views

How to create a QueueWorker and run it without cron

Can someone please help me with an example on how to create a QueueWorker class, add items, and run it inside hook_ENTITY_TYPE_presave() or anywhere in a module file? Basically, what I want is adding ...
Dynamdilshan's user avatar
1 vote
2 answers
528 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 ...
Benjen's user avatar
  • 918
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); $...
Mike's user avatar
  • 1,261
1 vote
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 ...
awm's user avatar
  • 2,429
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?
Ahmad's user avatar
  • 2,835
1 vote
1 answer
394 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 ...
Robbert's user avatar
  • 553
1 vote
1 answer
383 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 ...
Ynhockey's user avatar
  • 420
1 vote
1 answer
61 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\...
esod's user avatar
  • 309
1 vote
1 answer
432 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 ...
mohit_rocks's user avatar
  • 3,956
1 vote
1 answer
223 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 ...
Beyerz's user avatar
  • 238
1 vote
0 answers
191 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 ...
Chris's user avatar
  • 516
1 vote
0 answers
270 views

How to execute migration in queue through cron run?

I am migrating some nodes from an API. The API only accepts 60 requests per minute. So it means if 60 items are imported in a minute, all other items will not be imported because the API will return ...
Ahmad's user avatar
  • 2,835
1 vote
1 answer
368 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 ...
neuquen's user avatar
  • 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 ...
jokle's user avatar
  • 11
1 vote
0 answers
719 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 ...
Mamadou's user avatar
  • 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 ...
geerlingguy's user avatar
  • 5,483