3

Definitions from the documentation:

  • queue/run: runs all the queued-up jobs
  • queue/listen: listens to the queue and runs new jobs

Example case:

The runQueueAutomatically config option is set to false, and a cron job is calling queue/run every minute: /1 * * * * /path/to/project/root/craft queue/run.

In this case:

  • Should I run queue/listen instead of queue/run?
  • Does calling a new queue/run when a queue/run job is potentially still in process, could caused queue issues?

1 Answer 1

3
  • queue/run - should be used if you're going to manually execute this command via a cron job or such, because it runs any pending queue jobs, then exits

  • queue/listen - should be used if you want it to constantly poll (with a reasonable cooldown interval) for new jobs, and run them, because it runs a listen process that spawns a sub-process to run queue jobs as they come in

More here: Robust queue job handling in Craft CMS

2
  • Thank you! Why you didn't mention the queue/run cron job solution in your article? Are there downsides using it instead of setting up a service with systemd?
    – Romain P.
    Commented Aug 22, 2019 at 12:06
  • It's just a bit less elegant but it should work fine. Commented Aug 22, 2019 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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