Skip to content

Commit

Permalink
add expiration after insert subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
fengys1996 committed Feb 19, 2025
1 parent ccfb138 commit 1df1c2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/producer/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ impl ResultFetcher {

let (tx, rx) = channel();
self.inner.subscriptions.insert(request_id, tx);
let expired_at = Instant::now() + Duration::from_secs(5);
self.inner
.expirations
.write()
.unwrap()
.push_back((request_id, expired_at));
Ok(rx)
}

Expand Down

0 comments on commit 1df1c2f

Please sign in to comment.