HangfireIO / HangfireIO/Hangfire
Keep watching JobId state
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
Hi All,
Am using hangfire to run background works, like below.
In my business layer calling Data access layer to get some data(Long running) then do some business calculation and update into backend.
This block of process code i moved into hangfire section
var tempJobId = BackgroundJob.Enqueue(() => hngFire.HangFireStartNewJob(JobCancellationToken.Null));
Here i got what i needed, my sceario is when i called BackgroundJob.Enqueue() i got job id for specific request, then program control move to next line for further.
I want to keeo track request task(JobId) like if it Started, Processing, Cancelled, Failed, Success, etc.
Note: Auto code management, when i run application in mapped DB.[HangFire].[State] table been updating status for every Job.
How i get JobId status in my code?
Thanks,
jai
Contributor guide
Research direction
Start with the BackgroundJob.Enqueue call and its returned job ID, then inspect the [HangFire].[State] table mentioned in the report. Determine whether the requested Started, Processing, Cancelled, Failed, and Success tracking is already exposed for application code; done means documenting or defining a supported way to observe the job state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100