I’m concerned about these lines:
function OnJobFailure(jobId)
local job = ParseJson(RestApiGet("/jobs/" .. jobId))
if job["Type"] == "DicomModalityStore" then
local instanceId = job["Content"]["ParentResources"][1]
I want to fetch job details to grab instanceId and add it to local file to resend it later. Do i have guarantee that job is not deleted at the time of fetching according to JobsHistorySize?
For example If i set JobsHistorySize to 1000, and 5 instances failed and 1000 instances succeed after it, my first 5 failed jobs will be deleted and i can’t resume it or get instance id in job details.
If each job is executed after previous failed job callback (OnJobFailure), then we do have guarantee that RestApiGet(“/jobs/” … jobId) will return details.