Skip to content

Commit

Permalink
fixup! Use an interval to drive schedule updates in announcer
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed May 12, 2024
1 parent 2048e5b commit 8ac673b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/announcer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ pub struct Announcer {
impl Announcer {
pub async fn new(settings: AnnouncerSettings, client: Client) -> crate::Result<Self> {
let schedule = self::utils::get_sorted_schedule(&client).await?;
let schedule_update_interval = tokio::time::interval(settings.schedule_refresh);

let mut schedule_update_interval = tokio::time::interval(settings.schedule_refresh);
schedule_update_interval.reset();

Ok(Self {
settings,
Expand Down Expand Up @@ -124,7 +126,7 @@ impl Announcer {
return Ok(AnnouncerPollResult::ScheduleRefreshed(changes))
},
Err(e) => {
warn!("Failed to update schedule {e}")
warn!("Failed to update schedule: {e}")
},
}
}
Expand Down

0 comments on commit 8ac673b

Please sign in to comment.