Skip to content

Commit

Permalink
Merge pull request #14264 from webpack/bugfix/hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Sep 16, 2021
2 parents 20da4b1 + ff69b3f commit 6458896
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/cache/PackFileCacheStrategy.js
Expand Up @@ -118,6 +118,14 @@ class Pack {
this.requests.push(undefined);
this.requestsTimeout = undefined;
}, MAX_TIME_IN_FRESH_PACK);
if (this.requestsTimeout.unref) this.requestsTimeout.unref();
}
}

stopCapturingRequests() {
if (this.requestsTimeout !== undefined) {
clearTimeout(this.requestsTimeout);
this.requestsTimeout = undefined;
}
}

Expand Down Expand Up @@ -1232,6 +1240,7 @@ class PackFileCacheStrategy {
const reportProgress = ProgressPlugin.getReporter(this.compiler);
return (this.storePromise = packPromise
.then(pack => {
pack.stopCapturingRequests();
if (!pack.invalid) return;
this.packPromise = undefined;
this.logger.log(`Storing pack...`);
Expand Down

0 comments on commit 6458896

Please sign in to comment.