Commit Graph
11 Commits
Author SHA1 Message Date
Matt Godbolt 17c8ab8f46 Add stats for caches (#2300) 2020-10-20 14:51:31 -04:00
Austin Morton 044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Rubén Rincón BlancoandAustin Morton ccff4b9ee5 Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible

In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules

This PR attempts to not change code behavior when possible.  In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the 
code base to silence the error.  You can find these by searching for `eslint-disable-next-line`.

Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2020-08-04 16:39:02 -04:00
Austin Morton 4760ae92de Update dependencies (#1842) 2020-02-25 02:46:41 -05:00
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