fix: unscheduling a recipe should not delete them (#8978)

Signed-off-by: Angie Jones <jones.angie@gmail.com>
This commit is contained in:
Angie Jones
2026-05-03 20:26:54 -05:00
committed by GitHub
parent 45d8bf81d0
commit 17c12bfbd8
8 changed files with 60 additions and 14 deletions
+3 -3
View File
@@ -192,7 +192,7 @@ async fn list_schedules(
("id" = String, Path, description = "ID of the schedule to delete")
),
responses(
(status = 204, description = "Scheduled job deleted successfully"),
(status = 204, description = "Scheduled job removed successfully"),
(status = 404, description = "Scheduled job not found"),
(status = 500, description = "Internal server error")
),
@@ -205,13 +205,13 @@ async fn delete_schedule(
) -> Result<StatusCode, ErrorResponse> {
let scheduler = state.scheduler();
scheduler
.remove_scheduled_job(&id, true)
.remove_scheduled_job(&id, false)
.await
.map_err(|e| match e {
goose::scheduler::SchedulerError::JobNotFound(msg) => {
ErrorResponse::not_found(format!("Schedule not found: {}", msg))
}
_ => ErrorResponse::internal(format!("Error deleting schedule: {}", e)),
_ => ErrorResponse::internal(format!("Error removing schedule: {}", e)),
})?;
Ok(StatusCode::NO_CONTENT)
}