Skip to content

Commit

Permalink
make controller::Config::debounce() a builder
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Jaiswal <[email protected]>
  • Loading branch information
aryan9600 committed Aug 5, 2023
1 parent 599f5f8 commit 100fb57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kube-runtime/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ impl Config {
/// This option delays (and keeps delaying) reconcile requests for objects while
/// the object is updated. It can **permanently hide** updates from your reconciler
/// if set too high on objects that are updated frequently (like nodes).
pub fn debounce(&mut self, debounce: Duration) {
#[must_use]
pub fn debounce(mut self, debounce: Duration) -> Self {
self.debounce = debounce;
self
}
}

Expand Down Expand Up @@ -1331,8 +1333,6 @@ mod tests {

let (queue_tx, queue_rx) = futures::channel::mpsc::unbounded::<ObjectRef<ConfigMap>>();
let (store_rx, mut store_tx) = reflector::store();
let mut config = Config::default();
config.debounce(Duration::from_millis(1));
let applier = applier(
|obj, _| {
Box::pin(async move {
Expand All @@ -1345,7 +1345,7 @@ mod tests {
Arc::new(()),
store_rx,
queue_rx.map(Result::<_, Infallible>::Ok),
config,
Config::default(),
);
pin_mut!(applier);
for i in 0..items {
Expand Down

0 comments on commit 100fb57

Please sign in to comment.