Browse Source

reset local file content if remote file is updated

fix https://github.com/seaweedfs/seaweedfs/issues/4289
pull/4423/head
chrislu 2 years ago
parent
commit
e1b92bc701
  1. 3
      weed/shell/command_remote_mount.go

3
weed/shell/command_remote_mount.go

@ -182,6 +182,9 @@ func doSaveRemoteEntry(client filer_pb.SeaweedFilerClient, localDir string, exis
existingEntry.RemoteEntry = remoteEntry existingEntry.RemoteEntry = remoteEntry
existingEntry.Attributes.FileSize = uint64(remoteEntry.RemoteSize) existingEntry.Attributes.FileSize = uint64(remoteEntry.RemoteSize)
existingEntry.Attributes.Mtime = remoteEntry.RemoteMtime existingEntry.Attributes.Mtime = remoteEntry.RemoteMtime
existingEntry.Attributes.Md5 = nil
existingEntry.Chunks = nil
existingEntry.Content = nil
_, updateErr := client.UpdateEntry(context.Background(), &filer_pb.UpdateEntryRequest{ _, updateErr := client.UpdateEntry(context.Background(), &filer_pb.UpdateEntryRequest{
Directory: localDir, Directory: localDir,
Entry: existingEntry, Entry: existingEntry,

Loading…
Cancel
Save