Closed ammirator-administrator closed 2 days ago
Hi, would you like to prepare a PR for this feature? I'll more than happy to review it 😉
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 ui
& api
folders in packages
There is already a route GET /api/queues/:queueName/:jobId
. I think just a UI element calling this endpoint will work. Let me know if I am wrong @felixmosh
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 after this search may be extended and search by something else
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 That would be great if you can open such PR I think this feature will help a lot of peoples to investigate their jobs
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. The code is pretty straightforward:
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). I don't want to know / use things that are not documented.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
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