Usage inside deployed app
This issue is similar to Issue #29. I'm using the memoise function inside an R Shiny app and deploying the app using RSConnect. (This work was done in my capacity as a Bayer employee, for the record.) On the deployed app, race conditions obtain when multiple R processes chase the same cached file. The race can result in a corrupted cache file, which will persist afterwards. The solution is to lock the files in the memoise package using a try ... finally pattern. I'm planning to fork off my own fixed version of memoise and submit those fixes back to the main branch.
If the issue is a race between $has_key() and $get(): that's something that we're planning on addressing, with some general changes to the caching system. Regarding the possibility of multiple processes writing to the same file (as in #29), that's also something we will address -- the solution is to write to a temp file, then rename it.