-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to find a job in queue by it's ID #715
Comments
Hi, would you like to prepare a PR for this feature? I'll more than happy to review it 😉 |
Hello, I'd like to contribute to this project. Is there any project documentation that could help me quickly understand the architecture and add functionalities? |
Nope, just review the |
There is already a route GET |
Yeah, you are probably right... But it will return always one / zero result. I prefer to implement a full search (once the underline lib will add it, vote for my request) |
At least by ID would be good as Initial step I do not think that bullmq will add ever a fullsearch capability since it uses redis and to do something as full search with redis is hard At the beginning it may be just by ID at least, since a lot of peoples just stores the IDs related to some job in a simple database so that they can cancel later or do some investigation if needed |
I agree. It's unlikely that bullmq will provide a fullsearch. To implement fullsearch from our side we will need to store the index in redis, if bullmq exports the redis client. Still it would not be best to utilise redis resources from the bull-board. Our best bet is to implement search by ID. If this is something we want to implement than I can work on a PR. |
Thanks @suyash-thakur |
I recently had to implement a search by job id prefix and I believe we could use the same approach for a simple job search engine. It's still not a full search but it adds a level of flexibility in the searches. import { Queue, Job } from "bullmq";
export const getJobsByIdPrefix = async (queue: Queue, idPrefix: string, COUNT = 1000) => {
const client = await queue.client;
const BASE_MATCH = `bull:${queue.name}:`;
const MATCH = `${BASE_MATCH}${idPrefix}*`;
const [_, keys] = await client.scan(0, "MATCH", MATCH, "COUNT", COUNT);
const promises = keys.map((key) => {
const jobId = key.replace(BASE_MATCH, "");
return Job.fromId(queue, jobId);
});
return Promise.all(promises);
} @suyash-thakur @felixmosh What do you think about this approach? |
You are using details that related to the storage (implementation details). |
At the moment we have the list of all jobs in a queue separated in different tabs by it's status
But there is no possibility to find a job by it's ID and investigate it in case if needed
Imagine having a platform even if small but which handles let's say 1000 jobs a day
In that list it would be hard to go manually thru all and find the one you need
A small filter at the top would be super useful to find a job
The text was updated successfully, but these errors were encountered: