diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-26 15:18:34 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-26 15:18:34 -0700 |
| commit | 05a648bb96df1be5a9261737d8f6fd01600c6a63 (patch) | |
| tree | 751a04da5a01ca0dd9233447b1789708bf8cba17 /weed/shell/command_remote_uncache.go | |
| parent | c08ac536ed83ef2159a13ce826a249223272818f (diff) | |
| download | seaweedfs-05a648bb96df1be5a9261737d8f6fd01600c6a63.tar.xz seaweedfs-05a648bb96df1be5a9261737d8f6fd01600c6a63.zip | |
refactor: separating out remote.proto
Diffstat (limited to 'weed/shell/command_remote_uncache.go')
| -rw-r--r-- | weed/shell/command_remote_uncache.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/shell/command_remote_uncache.go b/weed/shell/command_remote_uncache.go index ac7e44a7d..369f2b3d4 100644 --- a/weed/shell/command_remote_uncache.go +++ b/weed/shell/command_remote_uncache.go @@ -83,6 +83,7 @@ func (c *commandRemoteUncache) Do(args []string, commandEnv *CommandEnv, writer func (c *commandRemoteUncache) uncacheContentData(commandEnv *CommandEnv, writer io.Writer, dirToCache util.FullPath, fileFilter *FileFilter) error { return recursivelyTraverseDirectory(commandEnv, dirToCache, func(dir util.FullPath, entry *filer_pb.Entry) bool { + if !mayHaveCachedToLocal(entry) { return true // true means recursive traversal should continue } @@ -98,7 +99,7 @@ func (c *commandRemoteUncache) uncacheContentData(commandEnv *CommandEnv, writer entry.RemoteEntry.LastLocalSyncTsNs = 0 entry.Chunks = nil - println(dir, entry.Name) + fmt.Fprintf(writer, "Uncache %+v ... ", dir.Child(entry.Name)) err := commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { _, updateErr := client.UpdateEntry(context.Background(), &filer_pb.UpdateEntryRequest{ @@ -111,6 +112,7 @@ func (c *commandRemoteUncache) uncacheContentData(commandEnv *CommandEnv, writer fmt.Fprintf(writer, "uncache %+v: %v\n", dir.Child(entry.Name), err) return false } + fmt.Fprintf(writer, "Done\n") return true }) |
