timeout shell sync

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-05-26 11:20:44 +03:00
1 parent 0466971a6c
commit e0ade0f3c2
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}`);
}