When I set up continuation of my job, I'd expect JobStorage.Current.GetMonitoringApi().JobDetails.History to contain a state where the job is "Succeeded" (in happy path). However, it randomly happens that the latest entry there is "Processing".
Is it expected?
Here's simplified version of my code:
var state = new EnqueuedState("my-queue");
var jobId = client.Create<MyJob>(
job => job.Run(cancellationToken),
state
);
client.ContinueJobWith(
jobId,
() => DoSomething(jobId),
state
);
public async Task DoSomething(sting jobId)
{
var jobDetails = JobStorage.Current.GetMonitoringApi().JobDetails(jobId);
var lastJobState = jobDetails.History.OrderByDescending(state => state.CreatedAt).First();
_logger.log(lastJobState.StateName); // logs "Processing" for some jobs
}
If I'm doing something wrong, what's the proper way to get the job's state and timestamp of its finished execution?
When I set up continuation of my job, I'd expect
JobStorage.Current.GetMonitoringApi().JobDetails.History
to contain a state where the job is "Succeeded" (in happy path). However, it randomly happens that the latest entry there is "Processing". Is it expected?Here's simplified version of my code:
If I'm doing something wrong, what's the proper way to get the job's state and timestamp of its finished execution?