MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / watchObjectChanges

Function watchObjectChanges

mount/mount.go:142–164  ·  view source on GitHub ↗
(srv *fs.Server, fs *FS)

Source from the content-addressed store, hash-verified

140}
141
142func watchObjectChanges(srv *fs.Server, fs *FS) {
143 for {
144 select {
145 case objects, more := <-fs.client.ChangedObjects:
146 if !more {
147 return
148 }
149 for _, object := range objects {
150 o := Object{fs, object.ObjectID}
151 fs.lock.Lock()
152 if _, exists := fs.objectCache[o.objectID]; exists {
153 fs.objectCache[o.objectID] = object
154 }
155 fs.lock.Unlock()
156 if err := srv.InvalidateNodeData(o); err != nil && err != fuse.ErrNotCached {
157 Log.Warningf("Failed to invalidate object %v", object.ObjectID)
158 } else {
159 Log.Debugf("Invalidated object %v", object.ObjectID)
160 }
161 }
162 }
163 }
164}
165
166// Unmount unmounts the mountpoint
167func Unmount(mountpoint string, notify bool) error {

Callers 1

MountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected