Commit Graph
7 Commits
Author SHA1 Message Date
Austin Morton be8b8aa245 Avoid deleting file when updating a key in disk cache
When setting a key, the file is written to disk first and then
the cache entry is set.  When the key already exists, the dispose
callback will end up deleting the *updated* file from disk.

This results in a cache entry with no corresponding file on disk.
2019-08-23 10:10:16 -04:00
Austin Morton 12380a4a95 Gracefully handle IO errors in disk cache
There appears to be a race condition between key eviction
and access.  It is possible for the file to be deleted from disk,
but the key to still be in the cache momentarily.

If someone tries to access the key during this period a
file not found error will be thrown, and odd behavior may
occur in the caller.

Instead, we catch/log errors and return a cache miss.
2019-08-23 09:44:20 -04:00
Patrick Quist df78b11679 Update on-disk.js 2019-07-19 20:57:30 +02:00
RabsRincon 57cb1e824a Completely remove need for denodeify
fs-extra already does what we were asking the package to do
2019-07-19 15:11:16 +02:00
Matt Godbolt 5ba712213a Addressing @RabsRincon comments 2018-05-20 11:10:52 -05:00
Matt Godbolt 72760b65a4 Support creation of cache chains from config strings 2018-05-18 08:21:24 -05:00
Matt Godbolt 36b720806a First attempt at some new caching; including in-memory, on-disk, and on S3 2018-05-17 23:01:52 -05:00