MCPcopy
hub / github.com/mudler/LocalAI / setImportMessage

Method setImportMessage

core/services/quantization/service.go:597–605  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
597func (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.
608func (s *QuantizationService) setImportFailed(job *schema.QuantizationJob, message string) {

Callers 1

ImportModelMethod · 0.95

Calls 4

saveJobStateMethod · 0.95
LockMethod · 0.65
SetMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected