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:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@trigger.dev/cli": patch
|
||||
---
|
||||
|
||||
Increase the yalt.dev connection timeout to 5 seconds
|
||||
@@ -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}` });
|
||||
|
||||
Reference in New Issue
Block a user