mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00: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) {
|
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 a new issue