Answers.Body: <p>The priority option is for setting the jobs in priority order before they start. A job that is already running will not be interrupted for a more important one.</p>
  <p>I would suggest setting up another queue for the longer tasks. That way, your smaller tasks can continue to run separate to the more demanding ones.</p>
  <p>There is some guidance on how to do this on an issue <a href="https://github.com/craftcms/cms/issues/5492#issuecomment-578889366" rel="nofollow noreferrer">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-27T21:50:20.937Z
Answers.LastActivityDate: 2021-04-27T21:50:20.937Z
Answers.UserDisplayName: Matt Banner
Body: <p>I'm currently working on a plug-in for Craft. I have to work with a lot of data and, some steps are slow. So that's why I added them to a job system. This job is doing a lot of stuff.</p>
  <p>That job is blocking the other jobs that are also important. Is there a way to push a new job to the top of the list and start it directly in Craft 3?</p>
  <p>I tried to priority tasks (<a href="https://craftcms.com/docs/3.x/extend/queue-jobs.html#specifying-priority" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/extend/queue-jobs.html#specifying-priority</a>) and, it didn't work.</p>
  
Tags: <craft3><php><queue>
Title: Force craft to do another job (queue) and pause the current one
ThreadText: # Force craft to do another job (queue) and pause the current one
  
  (Asked by: username_0 on 2021-04-07)
  
  I'm currently working on a plug-in for Craft. I have to work with a lot of data and, some steps are slow. So that's why I added them to a job system. This job is doing a lot of stuff.
  
  That job is blocking the other jobs that are also important. Is there a way to push a new job to the top of the list and start it directly in Craft 3?
  
  I tried to priority tasks (<https://craftcms.com/docs/3.x/extend/queue-jobs.html#specifying-priority>) and, it didn't work.
  
  **Tags:** craft3, php, queue
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-04-27. Score: 1
  
  The priority option is for setting the jobs in priority order before they start. A job that is already running will not be interrupted for a more important one.
  
  I would suggest setting up another queue for the longer tasks. That way, your smaller tasks can continue to run separate to the more demanding ones.
  
  There is some guidance on how to do this on an issue [here](https://github.com/craftcms/cms/issues/5492#issuecomment-578889366).
  
  
  ---
  
  