Run Cleanup function if DAG times out

Our system pulls generated reports from a retailer with an unreliable reporting system. Basically we submit the report and check back every five minutes in hopes that it will be finished. Sometimes these reports are never finished. We have our DAGs set up to just call it quits after 23 hours so it can start pulling all reports again an hour later. If this timeout is reached is there a way to call a final clean up function before the DAG stops its execution?