Some interesting ideas

Moved from https://github.com/odinserj/HangFire/issues/55 (to not to bloat the source topic), ideas from @devmondo:

another idea, is to query manually for jobs ids in code and force retry.

another idea for the Monitor UI is to create a new tab where failed jobs will have a button next to them to requeue them.

it is a good idea also to have the ability to filter jobs both in Monitor and code, specially when you have thousands of them.

tosum it, i humbly think all Monitor GUI features should be available in code and vise versa.

this will be so great and very useful if implemented

another idea, is to query manually for jobs ids in code and force retry.

What query parameters do you want to have? As for now, if you want to retry a job and know its Id, you can do the following:

var factory = new StateMachineFactory(JobStorage.Current);
var stateMachine = factory.Create(connection);
var state = new EnqueuedState();

stateMachine.TryToChangeState(jobId, state, new [] { FailedState.StateName });

I think I do not understand you. Do you mean the “Retry” button that is already here?

Very good idea. I think there should be ability to filter jobs either by type and method names.

HangFire Monitor uses HangFire’s public API. You are already able to do this.

thanks, but this is for finding by jobid,

what i meant is something like linq, to be able to query on all Hangfire jobs, and see their status, so we can make decisions.

Damn, yeah you are correct on the Retry button, i was thinking of global button there to retry all jobs, whether, failed, successful or canceled

what i meant is something like linq, to be able to query on all Hangfire jobs, and see their status, so we can make decisions.

Unfortunately, there is no generic implementation for this case. HangFire uses different storages (Redis, SQL Server), and support for this feature is hard enough. We already discussed in short about job filtering, and that feature seem to me as more real.

Damn, yeah you are correct on the Retry button, i was thinking of global button there to retry all jobs, whether, failed, successful or canceled

I understood you about global retry button – I’ve added an GitHub issue for this. But these words are hard to me to understand:

whether, failed, successful or canceled

Do you want to tell me about global retrying of all existing jobs, regardless of their status (enqueued, succeeded) and so on? If so, can you show me the corresponding use case for this feature?

i am sorry if i was not clear enough

what i meant is to add global rety or re execute jobs in Succeeded and failed pages in the Hangfire Monitor, also if we have ability to add check box next to each item in the list of those pages to select specific jobs to retry or re execute it would be grea.

Yes, I dream about this feature too and I realized it to be implemented closely to GitHub Issues page. But before, we should implement the “Retry all” feature that is the first step to do this.

this is great to hear that you are on it too, this would be a life safer really