mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-4701] ADF check env - Fail if the env is not reachable (#6714)
* Fail if the env is not reachable * Remove useless file
This commit is contained in:
@@ -139,13 +139,17 @@ async function checkEnv() {
|
||||
});
|
||||
await alfrescoJsApi.login(program.username, program.password);
|
||||
} catch (e) {
|
||||
logger.info('Login error environment down or inaccessible');
|
||||
if (e.error.code === 'ETIMEDOUT') {
|
||||
logger.error('The env is not reachable. Terminating');
|
||||
process.exit(1);
|
||||
}
|
||||
logger.error('Login error environment down or inaccessible');
|
||||
counter++;
|
||||
if (MAX_RETRY === counter) {
|
||||
logger.info('Give up');
|
||||
logger.error('Give up');
|
||||
process.exit(1);
|
||||
} else {
|
||||
logger.info(`Retry in 1 minute attempt N ${counter}`);
|
||||
logger.error(`Retry in 1 minute attempt N ${counter}`);
|
||||
sleep(TIMEOUT);
|
||||
checkEnv();
|
||||
}
|
||||
|
Reference in New Issue
Block a user