dimo414 / bkt

a subprocess caching utility, available as a command line binary and a Rust library.
https://www.bkt.rs
MIT License
251 stars 13 forks source link

Ignore NotFound errors when deleting expired data. #42

Closed eatnumber1 closed 1 year ago

eatnumber1 commented 1 year ago

When starting bkt in parallel, the multiple bkts race to clean up expired data. This opens the possibility that deletions will fail because the file has already been deleted... but that's okay, we wanted to do that anyway. So this change ignores NotFound errors on the deletion.

Currently, the result of this race is errors as follows:

bkt: Cache lookup failed: Failed to remove expired data: No such file or directory (os error 2)

Fixes #38

dimo414 commented 1 year ago

Thanks @eatnumber1!