Jose Estudillo12/29/2022, 6:28 PM
owen12/29/2022, 7:39 PM
you can then check if it failed with
most_recent_run_record = context.instance.get_run_records( filters=RunsFilter(job_name=...) limit=1, )
. If the most recent run has failed, then you can check`most_recent_run_record.end_time` , which is a float timestamp (in UTC) representing when that run failed. You can compare that to the current time, and if it's more than (let's say) 2 hours ago, you can kick off a run of that job.
most_recent_run_record.dagster_run.status == DagsterRunStatus.FAILED
Jose Estudillo12/30/2022, 9:18 AM