(promise, name)
| 32 | } |
| 33 | |
| 34 | function withTimeout(promise, name) { |
| 35 | let timer; |
| 36 | const timeout = new Promise((_, reject) => { |
| 37 | timer = setTimeout(() => { |
| 38 | reject(new Error(`${name} timed out after ${timeoutMs}ms`)); |
| 39 | }, timeoutMs); |
| 40 | }); |
| 41 | return Promise.race([promise, timeout]).finally(() => clearTimeout(timer)); |
| 42 | } |
| 43 | |
| 44 | const configFile = process.env.A3S_CONFIG_FILE; |
| 45 | if (!configFile) { |