feat(ngcc): pause async ngcc processing if another process has the lockfile (#35131)

ngcc uses a lockfile to prevent two ngcc instances from executing at the
same time. Previously, if a lockfile was found the current process would
error and exit.

Now, when in async mode, the current process is able to wait for the previous
process to release the lockfile before continuing itself.

PR Close #35131
This commit is contained in:
Pete Bacon Darwin
2020-02-03 20:25:15 +00:00
committed by Alex Rickabaugh
parent 7e8ce24116
commit eef07539a6
10 changed files with 535 additions and 241 deletions

View File

@ -91,7 +91,7 @@ describe('CachedFileSystem', () => {
});
describe('invalidateCaches()', () => {
it('should use the delegate for `readFile()` if the path for the cached file has been invalidated',
it('should call the delegate `readFile()` if the path for the cached file has been invalidated',
() => {
spyOn(delegate, 'lstat').and.returnValue({isSymbolicLink: () => false});
const spy = spyOn(delegate, 'readFile').and.returnValue('Some contents');
@ -107,7 +107,7 @@ describe('CachedFileSystem', () => {
expect(spy).toHaveBeenCalledWith(abcPath);
});
it('should use the delegate `exists()` if the path for the cached file has been invalidated',
it('should call the delegate `exists()` if the path for the cached file has been invalidated',
() => {
const spy = spyOn(delegate, 'exists').and.returnValue(true);
fs.exists(abcPath); // Call once to fill the cache