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 rubenfiszel 354 days ago
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 admin 354 days ago
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 414 days ago
// Schedule recovery handler template
export async function main(
path: string, // The path of the script or flow that errored
schedule_path: string, // The path of the schedule
error: object, // The error of the last job that errored
error_started_at: string, // The start datetime of the last job that errored
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} failed and then recovered (script or flow: ${path})`,
);
console.log("Error:", error);
console.log("Success result:", success_result)
return error;
}
Submitted by hugo697 415 days ago
// Schedule recovery handler template
export async function main(
path: string, // The path of the script or flow that errored
schedule_path: string, // The path of the schedule
error: object, // The error of the last job that errored
latest_result: object, // The result of the latest successful
) {
console.log(
`Schedule ${schedule_path} failed (script or flow: ${path})`,
);
console.log(error);
console.log(latest_result)
return error;
}
Submitted by hugo697 419 days ago