[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:
Maurizio Vitale
2021-02-22 13:11:55 +00:00
committed by GitHub
parent f84ea5da72
commit 3f268bd5ff
5 changed files with 50 additions and 31 deletions

View File

@@ -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();
}