SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
handle nil chunk cache
Chris Lub9b7da905ef9
diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.goindex 682f5185ad..ead7a8d0b6 100644--- a/weed/util/chunk_cache/chunk_cache.go+++ b/weed/util/chunk_cache/chunk_cache.go@@ -47,6 +47,10 @@ func NewChunkCache(maxEntries int64, dir string, diskSizeMB int64, segmentCount}func (c *ChunkCache) GetChunk(fileId string) (data []byte) {+ if c == nil {+ return+ }+c.RLock()defer c.RUnlock()@@ -76,6 +80,9 @@ func (c *ChunkCache) GetChunk(fileId string) (data []byte) {}func (c *ChunkCache) SetChunk(fileId string, data []byte) {+ if c == nil {+ return+ }c.Lock()defer c.Unlock()@@ -107,6 +114,9 @@ func (c *ChunkCache) SetChunk(fileId string, data []byte) {}func (c *ChunkCache) Shutdown() {+ if c == nil {+ return+ }c.Lock()defer c.Unlock()for _, diskCache := range c.diskCaches {