mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-27 20:59:42 +08:00
make a local copy of the in memory cached data
This commit is contained in:
parent
3cbc40fa48
commit
4abb511db3
@ -32,5 +32,7 @@ func (c *ChunkCacheInMemory) GetChunk(fileId string) []byte {
|
||||
}
|
||||
|
||||
func (c *ChunkCacheInMemory) SetChunk(fileId string, data []byte) {
|
||||
c.cache.Set(fileId, data, time.Hour)
|
||||
localCopy := make([]byte, len(data))
|
||||
copy(localCopy, data)
|
||||
c.cache.Set(fileId, localCopy, time.Hour)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user