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

Function IsDiskCacheAvailable

common/disk_cache_config.go:170–177  ·  view source on GitHub ↗

IsDiskCacheAvailable 检查是否可以创建新的磁盘缓存

(requestSize int64)

Source from the content-addressed store, hash-verified

168
169// IsDiskCacheAvailable 检查是否可以创建新的磁盘缓存
170func IsDiskCacheAvailable(requestSize int64) bool {
171 if !IsDiskCacheEnabled() {
172 return false
173 }
174 maxBytes := GetDiskCacheMaxSizeBytes()
175 currentUsage := atomic.LoadInt64(&diskCacheStats.CurrentDiskUsageBytes)
176 return currentUsage+requestSize <= maxBytes
177}

Callers 3

ShouldUseDiskCacheFunction · 0.85
CreateBodyStorageFunction · 0.85

Calls 2

IsDiskCacheEnabledFunction · 0.85
GetDiskCacheMaxSizeBytesFunction · 0.85

Tested by

no test coverage detected