MCPcopy
hub / github.com/rclone/rclone / Close

Method Close

backend/cache/handle.go:291–306  ·  view source on GitHub ↗

Close will tell the workers to stop

()

Source from the content-addressed store, hash-verified

289
290// Close will tell the workers to stop
291func (r *Handle) Close() error {
292 r.mu.Lock()
293 defer r.mu.Unlock()
294 if r.closed {
295 return errors.New("file already closed")
296 }
297
298 close(r.preloadQueue)
299 r.closed = true
300 // wait for workers to complete their jobs before returning
301 r.workersWg.Wait()
302 r.memory.db.Flush()
303
304 fs.Debugf(r, "cache reader closed %v", r.offset)
305 return nil
306}
307
308// Seek will move the current offset based on whence and instruct the workers to move there too
309func (r *Handle) Seek(offset int64, whence int) (int64, error) {

Callers

nothing calls this directly

Calls 6

DebugfFunction · 0.92
closeFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
WaitMethod · 0.65
FlushMethod · 0.65

Tested by

no test coverage detected