Skip to content

How can a queue set itself to run again? #265

Answered by Skn0tt
mattjis asked this question in Q&A
Discussion options

You must be logged in to vote

You can access the queue itself by the following:

const queue = Queue(
	"api/example",
	async (id) => {
                await queue.enqueue(...)
	}
)

export default queue

You'll want to think about the following:

  1. From your snippet, I get the impression that you want to update the currently running job (id and override: true). This likely won't work as you expect it to. Create a totally new job instead by using a random id (or leave it blank).
  2. Enqueueing a job means making a call to the Quirrel API, which itself can take variable amounts of time. This could break easily! If possible, it's preferable to create all required jobs in advance instead of dynamically allocating new ones during …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Skn0tt
Comment options

@mattjis
Comment options

@Skn0tt
Comment options

@Skn0tt
Comment options

@mattjis
Comment options

Answer selected by mattjis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants