1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-25 03:48:10 +02:00

reset local file content if remote file is updated

fix https://github.com/seaweedfs/seaweedfs/issues/4289
This commit is contained in:
chrislu 2023-04-22 22:32:21 -07:00
parent ff7b6d779e
commit e1b92bc701

View file

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