fix: make trash cleanup best effort

This commit is contained in:
OpenClaw Agent
2026-09-21 19:56:41 +08:00
parent 75d6e45080
commit 725c3a08b1
+4 -1
View File
@@ -142,7 +142,10 @@ func (s Local) MoveToTrash(path, trashRoot string) error {
if e = movePath(p, target); e != nil {
return e
}
return cleanupTrash(trashRoot, 30*24*time.Hour)
// Cleanup is maintenance work; a successful move must not be reported as
// a failed delete merely because an unrelated stale trash entry is busy.
_ = cleanupTrash(trashRoot, 30*24*time.Hour)
return nil
}
func cleanupTrash(root string, maxAge time.Duration) error {