Skip to content

Commit

Permalink
[dev/build_ts_refs] check that commit in outDirs matches mergeBase (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 25, 2021
1 parent 6dc2734 commit f5e022b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/dev/typescript/ref_output_cache/ref_output_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,28 @@ export class RefOutputCache {
* written to the directory.
*/
async initCaches() {
const archive =
this.archives.get(this.mergeBase) ??
(await this.archives.getFirstAvailable([
this.mergeBase,
...(await this.repo.getRecentShasFrom(this.mergeBase, 5)),
]));

if (!archive) {
return;
}

const outdatedOutDirs = (
await concurrentMap(100, this.outDirs, async (outDir) => ({
path: outDir,
outdated: !(await matchMergeBase(outDir, archive.sha)),
outdated: !(await matchMergeBase(outDir, this.mergeBase)),
}))
)
.filter((o) => o.outdated)
.map((o) => o.path);

if (!outdatedOutDirs.length) {
this.log.debug('all outDirs have the most recent cache');
this.log.debug('all outDirs have a recent cache');
return;
}

const archive =
this.archives.get(this.mergeBase) ??
(await this.archives.getFirstAvailable([
this.mergeBase,
...(await this.repo.getRecentShasFrom(this.mergeBase, 5)),
]));

if (!archive) {
return;
}

Expand Down

0 comments on commit f5e022b

Please sign in to comment.