aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-28 23:48:48 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-28 23:48:48 -0700
commitca658a97c5248ba099356b006f0b341af53b0816 (patch)
tree8b59defed9a417c4fa2e9346a23cd8a64e851852 /weed/filesys/wfs.go
parent63ad1abccec691d2204b8dc63109ffeead0b0eed (diff)
downloadseaweedfs-ca658a97c5248ba099356b006f0b341af53b0816.tar.xz
seaweedfs-ca658a97c5248ba099356b006f0b341af53b0816.zip
add signatures to messages to avoid double processing
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index e9ee0864b..44c2895d3 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -67,6 +67,7 @@ type WFS struct {
chunkCache *chunk_cache.TieredChunkCache
metaCache *meta_cache.MetaCache
+ signature int32
}
type statsCache struct {
filer_pb.StatisticsResponse
@@ -82,6 +83,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
return make([]byte, option.ChunkSizeLimit)
},
},
+ signature: util.RandomInt32(),
}
cacheUniqueId := util.Md5String([]byte(option.FilerGrpcAddress + option.FilerMountRootPath + util.Version()))[0:4]
cacheDir := path.Join(option.CacheDir, cacheUniqueId)
@@ -92,7 +94,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
wfs.metaCache = meta_cache.NewMetaCache(path.Join(cacheDir, "meta"))
startTime := time.Now()
- go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano())
+ go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs.signature, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano())
grace.OnInterrupt(func() {
wfs.metaCache.Shutdown()
})