Edits history of script submission #9019 for ' Schedule recovery handler template (windmill)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    export async function main(
      path: string, // The path of the script or flow that errored
      is_flow: boolean, // Whether the runnable is a flow
      schedule_path: string, // The path of the schedule
      error: object, // The error details
      error_started_at: string, // The start datetime of the latest job that failed
      success_times: number, // The number of times the schedule succeeded before calling the recovery handler.
      success_result: object, // The result of the latest successful job
      success_started_at: string // The start datetime of the latest successful job
    ) {
      console.log(
        `Schedule ${schedule_path} recovered ${
          success_times > 1 ? success_times + " times in a row" : ""
        }\n${is_flow ? "Flow" : "Script"}: ${path}`
      );
      console.log(`Last failure at ${error_started_at}:`, error);
      console.log(`Last success at ${success_started_at}:`, success_result);
      return error;
    }

    Submitted by hugo697 606 days ago