cache: add support for polling

This commit is contained in:
remusb 2018-02-10 22:01:05 +02:00 committed by GitHub
parent 8a25ca786c
commit b33e3f779c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 351 additions and 94 deletions

View file

@ -272,7 +272,12 @@ func (o *Object) Remove() error {
fs.Debugf(o, "removing object")
_ = o.CacheFs.cache.RemoveObject(o.abs())
_ = o.CacheFs.cache.removePendingUpload(o.abs())
_ = o.CacheFs.cache.ExpireDir(NewDirectory(o.CacheFs, cleanPath(path.Dir(o.Remote()))))
parentCd := NewDirectory(o.CacheFs, cleanPath(path.Dir(o.Remote())))
_ = o.CacheFs.cache.ExpireDir(parentCd)
// advertise to DirChangeNotify if wrapped doesn't do that
if o.CacheFs.Fs.Features().DirChangeNotify == nil {
o.CacheFs.notifyDirChangeUpstream(parentCd.Remote())
}
return nil
}