style(ngcc): reformat of ngcc after clang update (#36447)
PR Close #36447
This commit is contained in:

committed by
Kara Erickson

parent
bfa55162de
commit
74b7a8eaf5
@ -52,7 +52,7 @@ export class AsyncLocker {
|
||||
if (attempts === 0) {
|
||||
this.logger.info(
|
||||
`Another process, with id ${pid}, is currently running ngcc.\n` +
|
||||
`Waiting up to ${this.retryDelay*this.retryAttempts/1000}s for it to finish.`);
|
||||
`Waiting up to ${this.retryDelay * this.retryAttempts / 1000}s for it to finish.`);
|
||||
}
|
||||
// The file is still locked by another process so wait for a bit and retry
|
||||
await new Promise(resolve => setTimeout(resolve, this.retryDelay));
|
||||
@ -60,7 +60,10 @@ export class AsyncLocker {
|
||||
}
|
||||
// If we fall out of the loop then we ran out of rety attempts
|
||||
throw new Error(
|
||||
`Timed out waiting ${this.retryAttempts * this.retryDelay/1000}s for another ngcc process, with id ${pid}, to complete.\n` +
|
||||
`(If you are sure no ngcc process is running then you should delete the lock-file at ${this.lockFile.path}.)`);
|
||||
`Timed out waiting ${
|
||||
this.retryAttempts * this.retryDelay /
|
||||
1000}s for another ngcc process, with id ${pid}, to complete.\n` +
|
||||
`(If you are sure no ngcc process is running then you should delete the lock-file at ${
|
||||
this.lockFile.path}.)`);
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,8 @@
|
||||
import {ChildProcess, fork} from 'child_process';
|
||||
|
||||
import {AbsoluteFsPath, CachedFileSystem, FileSystem} from '../../../../src/ngtsc/file_system';
|
||||
import {LogLevel, Logger} from '../../logging/logger';
|
||||
import {LockFile, getLockFilePath} from '../lock_file';
|
||||
import {Logger, LogLevel} from '../../logging/logger';
|
||||
import {getLockFilePath, LockFile} from '../lock_file';
|
||||
|
||||
import {removeLockFile} from './util';
|
||||
|
||||
|
@ -20,14 +20,14 @@ const fs = new NodeJSFileSystem();
|
||||
|
||||
// We create a logger that has the same logging level as the parent process, since it should have
|
||||
// been passed through as one of the args
|
||||
const logLevel = parseInt(process.argv.pop() !, 10);
|
||||
const logLevel = parseInt(process.argv.pop()!, 10);
|
||||
const logger = new ConsoleLogger(logLevel);
|
||||
|
||||
// We must store the parent PID now as it changes if the parent process is killed early
|
||||
const ppid = process.ppid.toString();
|
||||
|
||||
// The path to the lock-file to remove should have been passed as one of the args
|
||||
const lockFilePath = fs.resolve(process.argv.pop() !);
|
||||
const lockFilePath = fs.resolve(process.argv.pop()!);
|
||||
|
||||
logger.debug(`Starting unlocker at process ${process.pid} on behalf of process ${ppid}`);
|
||||
logger.debug(`The lock-file path is ${lockFilePath}`);
|
||||
@ -36,4 +36,6 @@ logger.debug(`The lock-file path is ${lockFilePath}`);
|
||||
* When the parent process exits (for whatever reason) remove the loc-file if it exists and as long
|
||||
* as it was one that was created by the parent process.
|
||||
*/
|
||||
process.on('disconnect', () => { removeLockFile(fs, logger, lockFilePath, ppid); });
|
||||
process.on('disconnect', () => {
|
||||
removeLockFile(fs, logger, lockFilePath, ppid);
|
||||
});
|
||||
|
@ -57,6 +57,7 @@ export class SyncLocker {
|
||||
`ngcc is already running at process with id ${pid}.\n` +
|
||||
`If you are running multiple builds in parallel then you should pre-process your node_modules via the command line ngcc tool before starting the builds;\n` +
|
||||
`See https://v9.angular.io/guide/ivy#speeding-up-ngcc-compilation.\n` +
|
||||
`(If you are sure no ngcc process is running then you should delete the lock-file at ${this.lockFile.path}.)`);
|
||||
`(If you are sure no ngcc process is running then you should delete the lock-file at ${
|
||||
this.lockFile.path}.)`);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user