From 94e35cdb3552498b25824950bde94334c8b25331 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 12 Apr 2020 03:34:36 -0700 Subject: [PATCH] mount: fix fix bug found by git bisect, but I do not understand why it can cause error! --- weed/util/chunk_cache/chunk_cache.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index 48e4bfb0d..9f2a0518f 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -90,9 +90,7 @@ func (c *ChunkCache) SetChunk(fileId string, data []byte) { c.Lock() defer c.Unlock() - if existingData := c.doGetChunk(fileId); len(existingData)==0{ - c.doSetChunk(fileId, data) - } + c.doSetChunk(fileId, data) } func (c *ChunkCache) doSetChunk(fileId string, data []byte) {