Skip to content

Commit

Permalink
Fix crash when caching results in watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmengels committed Mar 16, 2024
1 parent 0c82b00 commit 956b2cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Fixed a crash when running in watch mode related to not being able to fetch cache results.
- Improve the error message when failing to update suppression files.

## [2.11.0] - 2024-03-15
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function runElmReview() {
Runner.initializeApp(options, elmModulePath, reviewElmJson, appHash)
),

ResultCache.load(options, appHash)
ResultCache.load(options, options.resultCachePath(appHash))
]);

const success = await Runner.runReview(options, app);
Expand Down
3 changes: 1 addition & 2 deletions lib/result-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let worker = null;
const resultCache = new Map();
const promisesToResolve = new Map();

async function load(options, appHash) {
async function load(options, cacheFolder) {
// TODO Make caching work for all of these
if (
options.debug ||
Expand Down Expand Up @@ -47,7 +47,6 @@ async function load(options, appHash) {
}

resultCache.clear();
const cacheFolder = options.resultCachePath(appHash);
global.elmJsonReplacer = ResultCacheJson.replacer;

global.loadResultFromCache = (ruleName, ruleId) => {
Expand Down

0 comments on commit 956b2cc

Please sign in to comment.