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

timeout shell sync

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-05-26 11:20:44 +03:00
parent 0466971a6c
commit e0ade0f3c2

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}`);
}