reset local file content if remote file is updated
fix https://github.com/seaweedfs/seaweedfs/issues/4289
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user