timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

no more fetchAll? #512

Closed boehm-e closed 1 month ago

boehm-e commented 1 month ago

I try to fetch all jobs from a queue using this code:

const fetchedJobs = await queue.fetch("my-queue", { includeMetadata: true, batchSize: 20 });

but i only get active jobs, I would like to have all jobs of the queue including the created and completed ones. I see in other issues that there was a function fetchAll, but it looks like it has been removed. Also i found nothing about that in the documentation.

Is there a way to retrieve all jobs from a queue?

timgit commented 1 month ago

There's never been a fetchAll(), but you can use SQL for what you need for now