Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions about the Drupal Queue API.

0
votes
1answer
34 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 ...
1
vote
1answer
14 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\...
0
votes
3answers
53 views

Drupal Queue example : form_state->get('XXX') always empty

In D8 Queue example (QueueExampleForm.php), why $form_state->get('insert_counter') is alway empty during insertion into queue (after submit)?
0
votes
0answers
13 views

Limit Queue Item Processed

I have a queue with emails, to be sent out of the site i want to process this queue with a limit of 400 item per cron run is there a way to limit the number of items processed on each cron. i have ...
1
vote
1answer
67 views

Cron Queue API - 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
199 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 ...
4
votes
1answer
38 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 ...
0
votes
1answer
84 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; /...
1
vote
2answers
875 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 ...
0
votes
1answer
122 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 ...
3
votes
1answer
43 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 ...
0
votes
1answer
377 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 ...
0
votes
3answers
1k 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?
2
votes
3answers
4k views

Documentation or Tutorial on using Batch or Queue Services API Programmatically

I am working on importing content into my drupal 8 website from an external API that returns XML data. The calls to the API take a long time to process. When I make too many queries at once it takes ...
0
votes
1answer
192 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 ...
1
vote
3answers
2k 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 ...
0
votes
1answer
56 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 '...
3
votes
1answer
526 views

Long-running cron task never fully executed [duplicate]

I am developing a Drupal Cron that has a very long-running task. First I tried with a simple Cron, which, of course, did not work because of "Memory exhausted" PHP fatal error. Then, I developed a ...
1
vote
4answers
642 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 ?
0
votes
1answer
28 views

Assigning roles to all users during hook_install

I have a module that needs to create a new role and assign all users to that new role while it's being installed. I have the code to make this happen; however, currently I have 1500 users on my ...
1
vote
2answers
686 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?
1
vote
0answers
62 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 ...
0
votes
1answer
273 views

Run Batch process every 1 hour

Currently, I have a batch process that is triggered on a form submit. With more detail, I have something like this: function mymodule_form_submit($form, &$form_state) { // call some functions ...
0
votes
2answers
161 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 ...
2
votes
0answers
1k 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, ); ...
3
votes
0answers
544 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 ...
2
votes
1answer
141 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
1answer
435 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 ...
0
votes
1answer
208 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 ...
2
votes
2answers
335 views

Avoiding PHP timeout when geocoding many addresses - preferred method?

I have a script that's taking in a ton of address data from a CSV, converting it to JSON, and along the way it hits the Google Maps API to get the latitude and longitude of each address. It then ...
0
votes
1answer
57 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 ...
0
votes
0answers
431 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 > ...
0
votes
0answers
98 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 ...
0
votes
2answers
838 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 ...
1
vote
1answer
310 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 ...
1
vote
0answers
540 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 ...
1
vote
2answers
376 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 ...
4
votes
3answers
690 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....
2
votes
1answer
665 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 ...
2
votes
2answers
737 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 ...
4
votes
1answer
845 views

Execute pending queues using batch? Possible?

I have implemented the Queue API inside hook_cron, to do certain update operations on a site: function HOOK_cron() { $interval = variable_get('variable_val', 60 * 60 * 24); if (time() >= ...
0
votes
1answer
949 views

Removing Queue Table Items / Queue UI Module D7

While attempting to export the mysql database, I found that there was a large number of items in the drupal 7 queue tables "feeds_importer_expire" and "feeds_source_import", both have about 80,000+ ...
7
votes
1answer
232 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 ...
1
vote
2answers
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); $...
3
votes
2answers
848 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 ...
1
vote
1answer
385 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 ...
4
votes
4answers
496 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 ...
31
votes
5answers
12k 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 ...
3
votes
0answers
738 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?