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

Function ClearDiskCache

controller/performance.go:142–152  ·  view source on GitHub ↗

ClearDiskCache 清理不活跃的磁盘缓存

(c *gin.Context)

Source from the content-addressed store, hash-verified

140
141// ClearDiskCache 清理不活跃的磁盘缓存
142func ClearDiskCache(c *gin.Context) {
143 // 清理超过 10 分钟未使用的缓存文件
144 // 10 分钟是一个安全的阈值,确保正在进行的请求不会被误删
145 err := common.CleanupOldDiskCacheFiles(10 * time.Minute)
146 if err != nil {
147 common.ApiError(c, err)
148 return
149 }
150
151 common.ApiSuccessT(c, "Inactive disk cache cleared", nil)
152}
153
154// ResetPerformanceStats 重置性能统计
155func ResetPerformanceStats(c *gin.Context) {

Callers

nothing calls this directly

Calls 3

CleanupOldDiskCacheFilesFunction · 0.92
ApiErrorFunction · 0.92
ApiSuccessTFunction · 0.92

Tested by

no test coverage detected