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
2 votes
1 answer
163 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
0 votes
0 answers
53 views

How to trigger contrib module service function by route from my modules QueueWorker plugin processItem() function

I'm working on a custom module that creates a queue for a contributed module "the streaming module" to be specific where my module is called streaming_transcode_queue. In my module I have a ...
sidgrafix's user avatar
0 votes
1 answer
136 views

How can I delete an item depending on the processing result?

I have a queue that is processed while cron run. processItem($data) checks some requirements. How can I delete an item when some requirements are not met? Can I update an item (the $data array) and &...
dercheffe's user avatar
  • 151
2 votes
1 answer
344 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
7 votes
3 answers
600 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
2 votes
0 answers
75 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
1 vote
0 answers
216 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
291 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
0 votes
0 answers
124 views

EntitySubqueue save() only working with die() following it

I am trying to add an item to a sub-queue automatically on save. And for some reason, it only works if I include die() afterwards. This adds the new node to the queue function ...
ProGrammar's user avatar
0 votes
1 answer
333 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; ...
Sudheesh S Babu's user avatar
-1 votes
1 answer
214 views

Why is my custom webform handler, when called via cron, doesn't load and email attachments?

I created a custom webform handler that on postSave adds webform id to the queue: public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) { $item = array( '...
Margarita's user avatar
2 votes
0 answers
1k 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,739
2 votes
1 answer
82 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
763 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
0 answers
175 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
1 vote
1 answer
430 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
3 votes
1 answer
682 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
0 votes
0 answers
681 views

How To Get Item_id value in ProcessItem function

I developed a custom module which will process my items in queue. I have some custom table and custom action buttons to Process queue items. When i click on "Process Queue" button it will call the ...
user3463733's user avatar
0 votes
1 answer
307 views

Queue Implementation for third party api

In my website I have a form and which submits data to third party website. that api is available some time and not available some time. I need to create a queue mechanism to insert failed api calls ...
user3463733's user avatar
7 votes
2 answers
9k 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
2 votes
2 answers
394 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
  • 569
0 votes
3 answers
241 views

Create a Term Queue on views

I have a views showing some selected terms of a vocabulary. The Views block is created using Taxonomy Terms as content(show). It showing order by the terms tree. But my client want to sort it as their ...
moshiuramit's user avatar
0 votes
1 answer
138 views

Plugin Derivatives For Queue and Migration Plugins

I've created a custom Content Entity and a custom Content Entity Type, basically I'm mirroring the Node module but the purpose of this is to have external data to be synced with this setup(not using ...
Postovan Dumitru's user avatar
1 vote
1 answer
65 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
  • 319
2 votes
1 answer
447 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
0 votes
1 answer
211 views

Determine Next Item in DrupalQueue for Drupal 7

I am trying to figure out how Drupal pulls what will be the next item to be processed in the queue for Drupal 7. I have looked at SystemQueue::claimItem and I am missing something. I have a queue ...
Steve's user avatar
  • 31
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,459
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
0 votes
1 answer
526 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; /...
Josh's user avatar
  • 195
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
0 votes
1 answer
312 views

Ultimate Cron. Invoke a cron from a cron. Set a cron enabled status to TRUE till its queue gets empty. Then set it to FALSE

I am using Ultimate Cron for running individual cron runs and I see Ultimate Cron provide hook_cronapi() to create own cron task runs and provide enabled key as either TRUE or FALSE. My objective is ...
sarathkm's user avatar
  • 548
3 votes
1 answer
93 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
0 votes
1 answer
1k views

How to manage by cron a long-running queue of very many items

I'm creating a File Checker module that verifies files managed by Drupal actually exist at the uri where Drupal believes they are. It places an item in a queue for each file entity. As there could be ...
Jonathan's user avatar
  • 1,118
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
0 votes
1 answer
381 views

How to create queue for email sending

I am using PepiPost mail service and I created custom mail system class for integrating PepiPost service. I can successfully send email from Drupal site. If a connection timeout 504 occurs during ...
Vamsi's user avatar
  • 2,116
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
0 votes
1 answer
155 views

Revisions revert unexpectedly

I have a really horrible intermittent bug where a collection of nodes will reset to a previous revision. Here is an image of the revisions tab on the node: There are three unusual aspects: The '...
littledynamo's user avatar
  • 1,110
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
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
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
0 votes
2 answers
311 views

Trying to update node using node_save() produces integrity constraint exception

This is the first time I've tried to do this so I may be missing something really obvious. I'm developing a module which uses hook_node_insert() to catch the creation of a node, and puts the node into ...
Martin K's user avatar
  • 565
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
0 answers
947 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
2 votes
1 answer
236 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
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
  • 253
0 votes
1 answer
517 views

Insert task to Queue only if unique

I wanted a way to only insert items into the Queue when it was not already added. I want to have a large queue and work my way through it, simply adding as required. Previously I was deleting the ...
Paul's user avatar
  • 413
0 votes
1 answer
125 views

hook_cron_queue_info stopped

I'm trying to use Drupal Queue and Cron to execute a task. In the following example I: select all the users create an item in the queue for each of them define the function that has to be run for ...
lorenzo's user avatar
  • 307
0 votes
0 answers
593 views

After indexing items are not visible, solr server

After indexing the items aren't visible on the page. The index does work, but after refreshing the page, the indexed items aren't shown on the page. View index > Queue all items for reindexing > ...
Gilko's user avatar
  • 43
0 votes
0 answers
155 views

Implement a Queue in Cron

I am trying to implement a Queue for my cron job, but some how it is not working. Following is the code snippet I have tried, but it is not working. function hook_cron() { watchdog('notice', 'Cron is ...
Jayesh Jose's user avatar
0 votes
2 answers
980 views

Can emails be sent asynchronously via rules? (Using Queue?)

I have some rules set up to send email notifications for forum messages, comments and articles. Sometimes the number of users that need to receive the email are quite large and the page doesn't ...
Turion's user avatar
  • 466