CleanMatchPrefix 清理通配符匹配的缓存数据,类似于 https://*.example.com/prefix/
(prefix string)
| 224 | |
| 225 | // CleanMatchPrefix 清理通配符匹配的缓存数据,类似于 https://*.example.com/prefix/ |
| 226 | func (this *SQLiteFileList) CleanMatchPrefix(prefix string) error { |
| 227 | if len(prefix) == 0 { |
| 228 | return nil |
| 229 | } |
| 230 | |
| 231 | defer func() { |
| 232 | // TODO 需要优化 |
| 233 | this.memoryCache.Clean() |
| 234 | }() |
| 235 | |
| 236 | for _, db := range this.dbList { |
| 237 | err := db.CleanMatchPrefix(prefix) |
| 238 | if err != nil { |
| 239 | return err |
| 240 | } |
| 241 | } |
| 242 | return nil |
| 243 | } |
| 244 | |
| 245 | func (this *SQLiteFileList) Remove(hash string) error { |
| 246 | _, err := this.remove(hash, false) |
nothing calls this directly
no test coverage detected