MCPcopy Index your code
hub / github.com/coder/coder / StopRecording

Method StopRecording

agent/x/agentdesktop/api_test.go:171–206  ·  view source on GitHub ↗
(_ context.Context, recordingID string)

Source from the content-addressed store, hash-verified

169}
170
171func (f *fakeDesktop) StopRecording(_ context.Context, recordingID string) (*agentdesktop.RecordingArtifact, error) {
172 f.recMu.Lock()
173 defer f.recMu.Unlock()
174 if f.recordings == nil {
175 return nil, agentdesktop.ErrUnknownRecording
176 }
177 path, ok := f.recordings[recordingID]
178 if !ok {
179 return nil, agentdesktop.ErrUnknownRecording
180 }
181 f.stopCalls = append(f.stopCalls, recordingID)
182 if f.recStopCh != nil {
183 select {
184 case f.recStopCh <- recordingID:
185 default:
186 }
187 }
188 file, err := os.Open(path)
189 if err != nil {
190 return nil, err
191 }
192 info, err := file.Stat()
193 if err != nil {
194 _ = file.Close()
195 return nil, err
196 }
197 artifact := &agentdesktop.RecordingArtifact{
198 Reader: file,
199 Size: info.Size(),
200 }
201 if f.thumbnailData != nil {
202 artifact.ThumbnailReader = io.NopCloser(bytes.NewReader(f.thumbnailData))
203 artifact.ThumbnailSize = int64(len(f.thumbnailData))
204 }
205 return artifact, nil
206}
207
208func (f *fakeDesktop) RecordActivity() {
209 f.recMu.Lock()

Callers

nothing calls this directly

Calls 5

SizeMethod · 0.80
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected