Skip to content

Commit 2a3ead4

Browse files
committed
pollinator: Cleaned up configuration reload
1 parent d07c841 commit 2a3ead4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pollinator/src/bin/pollinator.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ async fn poll_comm_links(db: Database) -> Result<()> {
7676
.await?;
7777
loop {
7878
let cfgs = CommLinkCfg::lookup_all(db.clone()).await?;
79-
if cfgs.is_empty() {
80-
break;
81-
}
8279
tasks.retain(|name, task| {
8380
match cfgs.iter().find(|cfg| cfg.name() == name) {
8481
Some(cfg) => {
@@ -112,6 +109,7 @@ async fn poll_comm_links(db: Database) -> Result<()> {
112109
tasks.insert(name, task);
113110
}
114111
}
112+
// wait for any configuration change
115113
while let Some(not) = receiver.recv().await {
116114
if should_reload(&not, &cfgs) {
117115
log::info!(
@@ -128,7 +126,6 @@ async fn poll_comm_links(db: Database) -> Result<()> {
128126
}
129127
}
130128
}
131-
Ok(())
132129
}
133130

134131
/// Check if a notification should trigger reloading the configuration

0 commit comments

Comments
 (0)