Skip to content

Commit

Permalink
Hack: fix utilization never ending, by polling another stream?
Browse files Browse the repository at this point in the history
  • Loading branch information
esensar committed Jan 27, 2025
1 parent db6f273 commit e81af45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utilization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::stats;

#[pin_project]
pub(crate) struct Utilization<S> {
intervals: IntervalStream,
timer_tx: UnboundedSender<UtilizationTimerMessage>,
component_key: ComponentKey,
inner: S,
Expand Down Expand Up @@ -58,6 +59,7 @@ where
{
debug!(component_id = ?this.component_key, "Couldn't send utilization start wait message from wrapped stream.");
}
let _ = this.intervals.poll_next_unpin(cx);
let result = ready!(this.inner.poll_next_unpin(cx));
if this
.timer_tx
Expand Down Expand Up @@ -228,6 +230,7 @@ pub(crate) fn wrap<S>(
inner: S,
) -> Utilization<S> {
Utilization {
intervals: IntervalStream::new(interval(Duration::from_secs(5))),
timer_tx,
component_key,
inner,
Expand Down

0 comments on commit e81af45

Please sign in to comment.