-
Notifications
You must be signed in to change notification settings - Fork 25
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
How to retrieve jobs from hangfire with a given tag id? #59
Comments
You can try to use the same code as the monitoring pages are using? Hangfire.Tags/src/Hangfire.Tags/Dashboard/Pages/TagsJobsPage.cshtml Lines 37 to 56 in 90e17f9
Replace the variable Storage on line 37 with JobStorage.Current, and let me know how it goes. |
Thanks for the suggestion. I can't seem to make use of the TagsStorage class as it's marked as internal. |
You're absolutely right! Sorry about that. HangFire.Tags uses a mechanic where you're Razor cshtml page inherits The reason that's it this closed and difficult is the fact that you can have multiple dashboards on different url's, which makes the slug important when retrieving the correct So, I've added an extension method to the latest beta version (1.9.0-beta.2) of HangFire.Tags, which also requires an upgrade to HangFire 1.8.2. var tagstorage = JobStorage.Current.GetTagsMonitoringApi();
var matchingjobs = tagstorage.GetMatchingJobs(new[] { "tag1" }, 0, 10); I hope this helps solving your problem. Sorry for leaving this issue open this long. |
Does anyone know how can I retrieve jobs from Hangfire with a given tag id after using this extension? For instance, using a Where lambda expression or similar. I need to find out the status of all jobs with a certain tag.
(apologies in advance if this is not the right forum to ask)
The text was updated successfully, but these errors were encountered: