MCPcopy Create free account
hub / github.com/bodaay/HuggingFaceModelDownloader / handleGetJob

Method handleGetJob

internal/server/api.go:273–287  ·  view source on GitHub ↗

handleGetJob returns a specific job.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

271
272// handleGetJob returns a specific job.
273func (s *Server) handleGetJob(w http.ResponseWriter, r *http.Request) {
274 id := r.PathValue("id")
275 if id == "" {
276 writeError(w, http.StatusBadRequest, "Missing job ID", "")
277 return
278 }
279
280 job, ok := s.jobs.GetJob(id)
281 if !ok {
282 writeError(w, http.StatusNotFound, "Job not found", "")
283 return
284 }
285
286 writeJSON(w, http.StatusOK, job)
287}
288
289// handleCancelJob cancels a job.
290func (s *Server) handleCancelJob(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

writeErrorFunction · 0.85
writeJSONFunction · 0.85
GetJobMethod · 0.80

Tested by

no test coverage detected