Fix yalt.dev connection timeouts by increasing timeout from 1s to 5s (#851)

* Increase the yalt tunnel connection timeout to 5 seconds

* Add changeset
This commit is contained in:
Eric Allam
2024-01-17 10:27:57 +00:00
committed by GitHub
parent f209a3b364
commit 26f5e7774d
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Increase the yalt.dev connection timeout to 5 seconds
+9 -1
View File
@@ -542,7 +542,7 @@ async function createNativeTunnel(
https,
{
WebSocket: WebSocket.default,
connectionTimeout: 1000,
connectionTimeout: getConnectionTimeoutValue(),
maxRetries: 10,
},
{ verbose: process.env.TUNNEL_VERBOSE === "1" }
@@ -557,6 +557,14 @@ async function createNativeTunnel(
}
}
function getConnectionTimeoutValue() {
if (typeof process.env.TUNNEL_CONNECTION_TIMEOUT === "string") {
return parseInt(process.env.TUNNEL_CONNECTION_TIMEOUT);
}
return 5000;
}
async function createNgrokTunnel(hostname: string, port: number, spinner: Ora) {
try {
return await ngrok.connect({ addr: `${hostname}:${port}` });