setImportFailed sets the import status to failed with a message.
(job *schema.QuantizationJob, message string)
| 606 | |
| 607 | // setImportFailed sets the import status to failed with a message. |
| 608 | func (s *QuantizationService) setImportFailed(job *schema.QuantizationJob, message string) { |
| 609 | xlog.Error("Quantization import failed", "job_id", job.ID, "error", message) |
| 610 | s.mu.Lock() |
| 611 | job.ImportStatus = "failed" |
| 612 | job.ImportMessage = message |
| 613 | if err := s.jobs.Set(context.Background(), job); err != nil { |
| 614 | xlog.Warn("Failed to persist import failure", "job_id", job.ID, "error", err) |
| 615 | } |
| 616 | s.saveJobState(job) |
| 617 | s.mu.Unlock() |
| 618 | } |
| 619 | |
| 620 | // GetOutputPath returns the path to the quantized model file and a download name. |
| 621 | func (s *QuantizationService) GetOutputPath(userID, jobID string) (string, string, error) { |
no test coverage detected