ClearDiskCache 清理不活跃的磁盘缓存
(c *gin.Context)
| 140 | |
| 141 | // ClearDiskCache 清理不活跃的磁盘缓存 |
| 142 | func 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 重置性能统计 |
| 155 | func ResetPerformanceStats(c *gin.Context) { |
nothing calls this directly
no test coverage detected