"getting last successful job run hangfire status" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "getting last successful job run hangfire status" answered properly. Developers are finding an appropriate answer about getting last successful job run hangfire status related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like getting last successful job run hangfire status. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on getting last successful job run hangfire status.
getting last successful job run hangfire status
var jobName = performContext.BackgroundJob.Job.ToString();
var currentJobId = int.Parse(performContext.BackgroundJob.Id);
JobData jobFoundInfo = null;
using (var connection = JobStorage.Current.GetConnection()) {
var decrementId = currentJobId;
while (decrementId > currentJobId - 50 && decrementId > 1) { // try up to 50 jobs previously
decrementId--;
var jobInfo = connection.GetJobData(decrementId.ToString());
if (jobInfo.Job.ToString().Equals(jobName)) { // **THIS IS THE CHECK**
jobFoundInfo = jobInfo;
break;
}
}
if (jobFoundInfo == null) {
throw new Exception($"Could not find the previous run for job with name {jobName}");
}
return jobFoundInfo;
}
All those coders who are working on the Whatever based application and are stuck on getting last successful job run hangfire status can get a collection of related answers to their query. Programmers need to enter their query on getting last successful job run hangfire status related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about getting last successful job run hangfire status for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of getting last successful job run hangfire status while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "getting last successful job run hangfire status". Visit this developer's friendly online web community, CodeProZone, and get your queries like getting last successful job run hangfire status resolved professionally and stay updated to the latest Whatever updates.