setImportMessage updates the import message and persists the job state. Called from the background import goroutine, so it uses Background for write-through.
(job *schema.QuantizationJob, msg string)
| 595 | // setImportMessage updates the import message and persists the job state. Called |
| 596 | // from the background import goroutine, so it uses Background for write-through. |
| 597 | func (s *QuantizationService) setImportMessage(job *schema.QuantizationJob, msg string) { |
| 598 | s.mu.Lock() |
| 599 | job.ImportMessage = msg |
| 600 | if err := s.jobs.Set(context.Background(), job); err != nil { |
| 601 | xlog.Warn("Failed to persist import message", "job_id", job.ID, "error", err) |
| 602 | } |
| 603 | s.saveJobState(job) |
| 604 | s.mu.Unlock() |
| 605 | } |
| 606 | |
| 607 | // setImportFailed sets the import status to failed with a message. |
| 608 | func (s *QuantizationService) setImportFailed(job *schema.QuantizationJob, message string) { |
no test coverage detected