(req: HttpRequest, job_id: web::Path<String>)
| 705 | } |
| 706 | |
| 707 | async fn serve_video(req: HttpRequest, job_id: web::Path<String>) -> Result<HttpResponse> { |
| 708 | let video_path = PathBuf::from(format!("/gource_videos/gource_{}.mp4", job_id)); |
| 709 | if video_path.exists() { |
| 710 | Ok(NamedFile::open(video_path)? |
| 711 | .set_content_type(mime::APPLICATION_OCTET_STREAM) |
| 712 | .into_response(&req)) |
| 713 | } else { |
| 714 | Ok(HttpResponse::NotFound().json(serde_json::json!({ |
| 715 | "error": "Video not found" |
| 716 | }))) |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | async fn clear_gource_videos(job_store: web::Data<JobStore>) { |
| 721 | let path = Path::new("/gource_videos"); |
nothing calls this directly
no outgoing calls
no test coverage detected