From 892379fd472e4936d1332efb3420d950ba158e23 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 20 May 2025 12:55:11 +0200 Subject: [PATCH] nit --- backend/src/monitor.rs | 5 ++++- backend/windmill-common/src/s3_helpers.rs | 9 +++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/monitor.rs b/backend/src/monitor.rs index 24efd181c0..8b401e8acc 100644 --- a/backend/src/monitor.rs +++ b/backend/src/monitor.rs @@ -1126,7 +1126,10 @@ pub async fn reload_s3_cache_setting(db: &DB) { if let Err(e) = s3_client { tracing::error!("Error building s3 client from settings: {:?}", e) } else { - tracing::info!("Loaded object store {:?}", setting.unwrap().get_bucket()); + tracing::info!( + "Loaded object store {:?}", + setting.as_ref().unwrap().get_bucket() + ); *s3_cache_settings = Some(s3_client.unwrap()); } } diff --git a/backend/windmill-common/src/s3_helpers.rs b/backend/windmill-common/src/s3_helpers.rs index 041ca1a5f8..698fad1c4d 100644 --- a/backend/windmill-common/src/s3_helpers.rs +++ b/backend/windmill-common/src/s3_helpers.rs @@ -415,13 +415,10 @@ pub enum ObjectSettings { } impl ObjectSettings { - pub fn get_bucket(&self) -> &str { + pub fn get_bucket(&self) -> Option<&String> { match self { - ObjectSettings::S3(s3_settings) => s3_settings - .bucket - .as_ref() - .unwrap_or_else(|| "missingbucket".to_string()), - ObjectSettings::Azure(azure_settings) => &azure_settings.container_name, + ObjectSettings::S3(s3_settings) => s3_settings.bucket.as_ref(), + ObjectSettings::Azure(azure_settings) => Some(&azure_settings.container_name), } } }