Unlock before purging

This commit is contained in:
Ingo Oppermann
2025-07-23 14:16:06 +02:00
parent 46810bf64d
commit f1c0e7d796

View File

@@ -133,7 +133,6 @@ func (rfs *filesystem) UpdateCleanup(id string, newPatterns []Pattern, purge boo
newPatterns = rfs.compilePatterns(newPatterns)
rfs.cleanupLock.Lock()
defer rfs.cleanupLock.Unlock()
currentPatterns := rfs.cleanupPatterns[id]
delete(rfs.cleanupPatterns, id)
@@ -176,6 +175,8 @@ func (rfs *filesystem) UpdateCleanup(id string, newPatterns []Pattern, purge boo
}).Log("Remove pattern")
}
rfs.cleanupLock.Unlock()
if purge {
rfs.purge(onlyCurrent)
}