Closed StijnCaerts closed 1 year ago
won't this trigger on_job_done
all the time once "finished" is reached?
maybe change detect reaching "finished" state with:
if (
df.loc[i, "status"] != "finished"
and job_metadata["status"] == "finished"
):
It shouldn't make a difference, as the active jobs are filtered before iterating. Jobs already in the finished state will not be considered. https://github.com/Open-EO/openeo-python-client/blob/a1a2ec3f36eb755f8a10cde850c830b8cd7df86c/openeo/extra/job_management.py#L404-L412
thanks!
Right now, the
on_job_done()
method will only be triggered when the cached state isrunning
and the job status isfinished
. But it might be possible that the job manager was stopped and resumed later and jobs in another active state (created
,queued
) finished in the mean time. For example, this means that jobs going fromqueued
tofinished
will not trigger theon_job_done()
method.This PR changes the behaviour of the job manager to trigger the
on_job_done()
method on the transition from any active state to thefinished
state.