-3

I am creating queue items from a cronjob. But it seems they are not getting processed. Any ideas why?

Do we need to process the items separately? I mean i have created the worker class and everything.

Thanks BR/Pratip

1
  • Unfortunately, we cannot debug a site to which we don't have access as administrators. If you showed the code, we could tell you what is wrong in the code, but that could not be sufficient to tell you why the code doesn't work on the site where you are testing it.
    – avpaderno
    Commented Nov 28, 2019 at 8:05

1 Answer 1

3
  1. Make sure cron is running on your site.
  2. Make sure cron time is set on your QueueWorker
/**
 * Create node object from the imported XML content
 *  * @QueueWorker(
 *   id = "import_content_from_xml",
 *   title = @Translation("Import Content From XML"),
 *   cron = {"time" = 60}
 * )
 */

Source: An example module to help understanding the Queue API and the Batch API in Drupal 8.

I highly recommend using Queue UI to monitor the queue from there. If it is not running, check your database log and try running the process as a batch (sometimes that is easier to troubleshoot).

1
  • 1
    Thanks for your answer. The problem was something with the annotation of my queue worker class. But for others who find a similar problem of queue execution, you can take Isaiah's advice and create this direct route to process all the queue items in batch. That will show you if there are any errors. Running a cron might not always return you the exact error. Like in my case. Commented Nov 28, 2019 at 6:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.