Restart failed autorouting jobs

Hello there.
I will start a new topic so that my problem is clearer. as we learned here:!topic/orthanc-users/lKYAEWULz5o

Orthanc saves failed jobs, later they can be done manually in the “Jobs” section.
So knowing all this, I have a question, what is needed for the failed jobs to be completed automatically later. for example, once every couple of hours, check if the modality is available, make an attempt to complete all failed jobs. Please help =)


It is up to you to implement such an “auto-restart” logic using the REST API of Orthanc (for instance in a cron job):

Yes, I already understood that. But I posted this topic in the hope that someone has already solved this problem, maybe there is already a python script written by someone from the community.
I will look in this direction, if I find a solution, I will post it here