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

Method Close

core/backend/transcript_live.go:67–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67func (s *liveTranscriptionSession) Close() error {
68 s.closeOnce.Do(func() {
69 err := s.stream.CloseSend()
70 select {
71 case <-s.recvDone:
72 case <-time.After(liveCloseDrainTimeout):
73 xlog.Warn("live transcription: backend did not finalize in time; cancelling stream")
74 s.cancel()
75 <-s.recvDone
76 }
77 s.cancel()
78 if err == nil {
79 err = s.recvErr
80 }
81 s.closeErr = err
82 s.trace.record(err)
83 })
84 return s.closeErr
85}
86
87// liveSampleRate is the PCM rate of a live transcription session, fixed by
88// the session config sent in ModelTranscriptionLive.

Callers

nothing calls this directly

Calls 3

CloseSendMethod · 0.65
cancelMethod · 0.45
recordMethod · 0.45

Tested by

no test coverage detected