zkat / cacache-rs

A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
https://crates.io/crates/cacache
Other
523 stars 33 forks source link

pls add 'remove fully' option to remove() function #53

Closed fiag closed 11 months ago

fiag commented 1 year ago

According the npm/cacache rm.entry API

By default, this appends a new entry to the index with an integrity of null. If opts.removeFully is set to true then the index file itself will be physically deleted rather than appending a null

thanks a lot!

zkat commented 1 year ago

doing this would mean that the index would no longer be atomic. That's why deletions are done through appending null.

the JS version of cacache has a verify() method that is expected to be called in a "locked" environment when nothing else is running. I'd like to have that in cacache-rs too.

fiag commented 1 year ago

After read verify() method, seem that this method does not delete index files. And the index with an integrity of null will be ignored in the index::ls() method.