fix: unscheduling a recipe should not delete them (#8978)
Signed-off-by: Angie Jones <jones.angie@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user