获取某类缓存总大小
(type: string)
| 98 | |
| 99 | /** 获取某类缓存总大小 */ |
| 100 | getSize(type: string): number { |
| 101 | const result = this.db |
| 102 | .prepare("SELECT SUM(size) as total FROM kv_cache WHERE type = ?") |
| 103 | .get(type) as { total: number }; |
| 104 | return result.total || 0; |
| 105 | } |
| 106 | |
| 107 | /** 获取所有缓存总大小 */ |
| 108 | getTotalSize(): number { |
no test coverage detected