1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Timeout shell env sync (#2874)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-05-26 15:17:10 +03:00 committed by GitHub
parent 08d462ab37
commit 4daf7f6526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,12 @@ export async function shellSync() {
let envVars = {}; let envVars = {};
try { 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) { } catch (error) {
logger.error(`shellEnv: ${error}`); logger.error(`shellEnv: ${error}`);
} }