duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

implementing clean-cache #443

Closed dominicbarnes closed 9 years ago

dominicbarnes commented 9 years ago

This adds Duo#cleanCache() to the API and duo clean-cache to the CLI. This particular "cache clean" destroys components/duo.json, and the CLI also calls upon Package.cleanCache() to round out all of duo's current caching implements.

This will address #437

matthewmueller commented 9 years ago

arg haha, this is a good intermediary step. I think the caching has to do with a race condition because I can't reproduce it all the time.

I was looking into it this weekend along with how browserify-incremental does it (spoiler: it doesn't).

dominicbarnes commented 9 years ago

Yeah, I've just accepted it as a necessary evil for now too.

I'm sure we can improve upon the entire caching model, perhaps even using a more sophisticated system under the hood. (maybe a proper database like leveldb or something?)

matthewmueller commented 9 years ago

If we can come up with a simplified, reproducible case where the caching layer fails, I think that would be a good start. I haven't even been able to do that. I just know it fails a lot

matthewmueller commented 9 years ago

My initial guess is that the mapping is read and not updated after writes by multiple instances of duo. we have atomic writes, but we let consumers read the mapping whenevs