This commit is contained in:
Ruben Fiszel
2025-05-20 12:55:13 +02:00
parent 25f71127c3
commit 892379fd47
2 changed files with 7 additions and 7 deletions
+4 -1
View File
@@ -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());
}
}
+3 -6
View File
@@ -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),
}
}
}