remove object from dirCache. if it's a directory, remove all its children from dirCache too. if it's a file, remove its link from linkCache.
(storage driver.Driver, dirPath string, obj model.Obj)
| 67 | // if it's a directory, remove all its children from dirCache too. |
| 68 | // if it's a file, remove its link from linkCache. |
| 69 | func (cm *CacheManager) removeDirectoryObject(storage driver.Driver, dirPath string, obj model.Obj) { |
| 70 | key := Key(storage, dirPath) |
| 71 | if !obj.IsDir() { |
| 72 | cm.linkCache.DeleteKey(stdpath.Join(key, obj.GetName())) |
| 73 | } |
| 74 | |
| 75 | if storage.Config().NoCache { |
| 76 | return |
| 77 | } |
| 78 | if cache, exist := cm.dirCache.Get(key); exist { |
| 79 | if obj.IsDir() { |
| 80 | cm.deleteDirectoryTree(stdpath.Join(key, obj.GetName())) |
| 81 | } |
| 82 | cache.RemoveObject(obj.GetName()) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // cache user data |
| 87 | func (cm *CacheManager) SetUser(username string, user *model.User) { |
no test coverage detected