aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_remote_sync.go
diff options
context:
space:
mode:
authorAlexander <4584443+DragonStuff@users.noreply.github.com>2021-08-29 11:47:35 +0900
committerGitHub <noreply@github.com>2021-08-29 11:47:35 +0900
commitab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8 (patch)
treed041c13bed16bde0d4184e852729e8d8724304b9 /weed/command/filer_remote_sync.go
parent4128c1126a614873ea64beffc762856c4933d0aa (diff)
parent8b7063634f5b2f9fa0a58a36260f881ee18ebd13 (diff)
downloadseaweedfs-ab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8.tar.xz
seaweedfs-ab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8.zip
Merge branch 'chrislusf:master' into master
Diffstat (limited to 'weed/command/filer_remote_sync.go')
-rw-r--r--weed/command/filer_remote_sync.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/weed/command/filer_remote_sync.go b/weed/command/filer_remote_sync.go
index e9286b705..db5ce8b90 100644
--- a/weed/command/filer_remote_sync.go
+++ b/weed/command/filer_remote_sync.go
@@ -116,11 +116,15 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour
}
lastOffsetTsNs, err := getOffset(option.grpcDialOption, *option.filerAddress, RemoteSyncKeyPrefix, int32(dirHash))
- if err == nil && mountedDirEntry.Attributes.Crtime < lastOffsetTsNs/1000000 {
- lastOffsetTs = time.Unix(0, lastOffsetTsNs)
- glog.V(0).Infof("resume from %v", lastOffsetTs)
+ if mountedDirEntry != nil {
+ if err == nil && mountedDirEntry.Attributes.Crtime < lastOffsetTsNs/1000000 {
+ lastOffsetTs = time.Unix(0, lastOffsetTsNs)
+ glog.V(0).Infof("resume from %v", lastOffsetTs)
+ } else {
+ lastOffsetTs = time.Unix(mountedDirEntry.Attributes.Crtime, 0)
+ }
} else {
- lastOffsetTs = time.Unix(mountedDirEntry.Attributes.Crtime, 0)
+ lastOffsetTs = time.Now()
}
} else {
lastOffsetTs = time.Now().Add(-*option.timeAgo)