From c4457bf2030b1ed157066aedfbc117c64e6618f3 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 18 Jul 2025 15:47:30 +1000 Subject: [PATCH] feat(gateway): shutdown after 15m of portal disconnect (#9894) --- rust/gateway/src/main.rs | 4 ++-- website/src/components/Changelog/Gateway.tsx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/gateway/src/main.rs b/rust/gateway/src/main.rs index 01d911173..914bf18e9 100644 --- a/rust/gateway/src/main.rs +++ b/rust/gateway/src/main.rs @@ -20,10 +20,10 @@ use phoenix_channel::get_user_agent; use futures::{TryFutureExt, future}; use phoenix_channel::PhoenixChannel; use secrecy::Secret; -use std::sync::Arc; use std::{collections::BTreeSet, path::Path}; use std::{fmt, pin::pin}; use std::{process::ExitCode, str::FromStr}; +use std::{sync::Arc, time::Duration}; use tokio::signal::ctrl_c; use tracing_subscriber::layer; use tun::Tun; @@ -175,7 +175,7 @@ async fn try_main(cli: Cli, telemetry: &mut Telemetry) -> Result<()> { (), || { ExponentialBackoffBuilder::default() - .with_max_elapsed_time(None) + .with_max_elapsed_time(Some(Duration::from_secs(60 * 15))) .build() }, Arc::new(tcp_socket_factory), diff --git a/website/src/components/Changelog/Gateway.tsx b/website/src/components/Changelog/Gateway.tsx index 16f7bc991..0b2957071 100644 --- a/website/src/components/Changelog/Gateway.tsx +++ b/website/src/components/Changelog/Gateway.tsx @@ -43,6 +43,10 @@ export default function Gateway() { would not get revoked if the Gateway was disconnected from the portal while access was removed. + + Shuts down the Gateway after 15m of being disconnected from the + portal. +