MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / CleanMatchPrefix

Method CleanMatchPrefix

internal/caches/list_file_sqlite.go:226–243  ·  view source on GitHub ↗

CleanMatchPrefix 清理通配符匹配的缓存数据,类似于 https://*.example.com/prefix/

(prefix string)

Source from the content-addressed store, hash-verified

224
225// CleanMatchPrefix 清理通配符匹配的缓存数据,类似于 https://*.example.com/prefix/
226func (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
245func (this *SQLiteFileList) Remove(hash string) error {
246 _, err := this.remove(hash, false)

Callers

nothing calls this directly

Calls 2

CleanMatchPrefixMethod · 0.65
CleanMethod · 0.45

Tested by

no test coverage detected