MCPcopy Create free account
hub / github.com/QuantumNous/new-api / ShouldUseDiskCache

Function ShouldUseDiskCache

common/disk_cache.go:167–176  ·  view source on GitHub ↗

ShouldUseDiskCache 判断是否应该使用磁盘缓存

(dataSize int64)

Source from the content-addressed store, hash-verified

165
166// ShouldUseDiskCache 判断是否应该使用磁盘缓存
167func ShouldUseDiskCache(dataSize int64) bool {
168 if !IsDiskCacheEnabled() {
169 return false
170 }
171 threshold := GetDiskCacheThresholdBytes()
172 if dataSize < threshold {
173 return false
174 }
175 return IsDiskCacheAvailable(dataSize)
176}

Callers 1

shouldUseDiskCacheFunction · 0.92

Calls 3

IsDiskCacheEnabledFunction · 0.85
IsDiskCacheAvailableFunction · 0.85

Tested by

no test coverage detected