Timeout shell env sync (#2874)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-05-26 15:17:10 +03:00
1 parent 08d462ab37
commit 4daf7f6526
1 file changed
+6 -1
+6 -1
View File
@@ -38,7 +38,12 @@ export async function shellSync() {
let envVars = {};
try {
envVars = await shellEnv(shell);
envVars = await Promise.race([
shellEnv(shell),
new Promise((_resolve, reject) => setTimeout(() => {
reject(new Error("Resolving shell environment is taking very long. Please review your shell configuration."));
}, 5_000))
]);
} catch (error) {
logger.error(`shellEnv: ${error}`);
}