From 6a15150d59a86bdbdbe785dce76edaf8407ca9da Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Fri, 26 Sep 2025 01:50:38 -0700 Subject: [PATCH] don't cleanup server type builders --- bin/core/src/cloud/mod.rs | 2 ++ bin/core/src/helpers/builder.rs | 9 ++++++--- bin/core/src/periphery/mod.rs | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/core/src/cloud/mod.rs b/bin/core/src/cloud/mod.rs index 3087d200f..60e9aa4ac 100644 --- a/bin/core/src/cloud/mod.rs +++ b/bin/core/src/cloud/mod.rs @@ -4,6 +4,8 @@ pub mod aws; pub enum BuildCleanupData { /// Nothing to clean up Server, + /// Cleanup Periphery connection + Url, /// Clean up AWS instance Aws { instance_id: String, region: String }, } diff --git a/bin/core/src/helpers/builder.rs b/bin/core/src/helpers/builder.rs index c51419cf9..d17dde0b8 100644 --- a/bin/core/src/helpers/builder.rs +++ b/bin/core/src/helpers/builder.rs @@ -62,7 +62,7 @@ pub async fn get_builder_periphery( .health_check() .await .context("Url Builder failed health check")?; - Ok((periphery, BuildCleanupData::Server)) + Ok((periphery, BuildCleanupData::Url)) } BuilderConfig::Server(config) => { if config.server_id.is_empty() { @@ -171,21 +171,24 @@ async fn get_aws_builder( ) } -#[instrument(skip(periphery, update))] +#[instrument(skip(update))] pub async fn cleanup_builder_instance( periphery: PeripheryClient, cleanup_data: BuildCleanupData, update: &mut Update, ) { - periphery.cleanup().await; match cleanup_data { BuildCleanupData::Server => { // Nothing to clean up } + BuildCleanupData::Url => { + periphery.cleanup().await; + } BuildCleanupData::Aws { instance_id, region, } => { + periphery.cleanup().await; let _instance_id = instance_id.clone(); tokio::spawn(async move { let _ = diff --git a/bin/core/src/periphery/mod.rs b/bin/core/src/periphery/mod.rs index 764a09b76..7f5ad3284 100644 --- a/bin/core/src/periphery/mod.rs +++ b/bin/core/src/periphery/mod.rs @@ -25,6 +25,7 @@ pub mod terminal; pub type ConnectionChannels = CloneCache>; +#[derive(Debug)] pub struct PeripheryClient { pub server_id: String, channels: Arc,