Skip to content

Commit

Permalink
Allow for select remote config manager config unloading
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
  • Loading branch information
bwoebi committed Sep 25, 2024
1 parent 08a5e36 commit b2f54b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion sidecar/src/service/sidecar_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#![allow(clippy::too_many_arguments)]

use crate::dogstatsd::DogStatsDAction;
use crate::service::{
InstanceId, QueueId, RequestIdentification, RequestIdentifier, RuntimeMetadata,
SerializedTracerHeaderTags, SessionConfig, SidecarAction,
Expand Down
14 changes: 14 additions & 0 deletions sidecar/src/shm_remote_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit b2f54b5

Please sign in to comment.