diff options
| author | ustuzhanin <55892859+ustuzhanin@users.noreply.github.com> | 2020-10-04 19:46:45 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-04 19:46:45 +0500 |
| commit | b3dd0ba446649d3a3fe56dba547585bf18b039b7 (patch) | |
| tree | fc22104e5b6b0ddd3c41ab02a72b2428130c2363 /weed/util | |
| parent | 3e0a79ef050dba9e5347d20537ef562cc4b30b62 (diff) | |
| parent | 8c8b8e2835801992ecd75349281637ed8ecb88cd (diff) | |
| download | seaweedfs-b3dd0ba446649d3a3fe56dba547585bf18b039b7.tar.xz seaweedfs-b3dd0ba446649d3a3fe56dba547585bf18b039b7.zip | |
Merge pull request #2 from chrislusf/master
update from upstream
Diffstat (limited to 'weed/util')
| -rw-r--r-- | weed/util/chunk_cache/chunk_cache.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index 608d605b1..3615aee0e 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -76,7 +76,7 @@ func (c *TieredChunkCache) doGetChunk(fileId string, minSize uint64) (data []byt return data } } - if minSize <= c.onDiskCacheSizeLimit2 { + { data = c.diskCaches[2].getChunk(fid.Key) if len(data) >= int(minSize) { return data @@ -115,7 +115,7 @@ func (c *TieredChunkCache) doSetChunk(fileId string, data []byte) { c.diskCaches[0].setChunk(fid.Key, data) } else if len(data) <= int(c.onDiskCacheSizeLimit1) { c.diskCaches[1].setChunk(fid.Key, data) - } else if len(data) <= int(c.onDiskCacheSizeLimit2) { + } else { c.diskCaches[2].setChunk(fid.Key, data) } |
