mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-02 20:16:37 +08:00
[缓存]实现按照目录刷新缓存
This commit is contained in:
@@ -134,7 +134,16 @@ func (this *MemoryStorage) CleanAll() error {
|
||||
}
|
||||
|
||||
// 批量删除缓存
|
||||
func (this *MemoryStorage) Purge(keys []string) error {
|
||||
func (this *MemoryStorage) Purge(keys []string, urlType string) error {
|
||||
// 目录
|
||||
if urlType == "dir" {
|
||||
resultKeys := []string{}
|
||||
for _, key := range keys {
|
||||
resultKeys = append(resultKeys, this.list.FindKeysWithPrefix(key)...)
|
||||
}
|
||||
keys = resultKeys
|
||||
}
|
||||
|
||||
for _, key := range keys {
|
||||
err := this.Delete(key)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user