diff --git a/sidecar/src/service/sidecar_interface.rs b/sidecar/src/service/sidecar_interface.rs index 47078736e..f03f4fe5e 100644 --- a/sidecar/src/service/sidecar_interface.rs +++ b/sidecar/src/service/sidecar_interface.rs @@ -3,7 +3,6 @@ #![allow(clippy::too_many_arguments)] -use crate::dogstatsd::DogStatsDAction; use crate::service::{ InstanceId, QueueId, RequestIdentification, RequestIdentifier, RuntimeMetadata, SerializedTracerHeaderTags, SessionConfig, SidecarAction, diff --git a/sidecar/src/shm_remote_config.rs b/sidecar/src/shm_remote_config.rs index b69f66f2a..e85e8fa2b 100644 --- a/sidecar/src/shm_remote_config.rs +++ b/sidecar/src/shm_remote_config.rs @@ -525,6 +525,20 @@ impl RemoteConfigManager { self.check_configs.clear(); self.active_configs.clear(); } + + pub fn unload_configs(&mut self, configs: &[RemoteConfigProduct]) { + self.active_configs.retain(|key, path| { + if configs.contains(&path.product) { + // self.check_configs should generally be empty here, but be safe + if let Some(pos) = self.check_configs.iter().position(|x| x == key) { + self.check_configs.swap_remove(pos); + } + false + } else { + true + } + }); + } } #[cfg(test)]