mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_udp: split cleaning interval for connections and torrents
This commit is contained in:
parent
5f10e5e7f4
commit
afe3e2465f
5 changed files with 20 additions and 13 deletions
|
|
@ -127,11 +127,11 @@ pub async fn run_socket_worker(
|
|||
let pending_scrape_responses = Rc::new(RefCell::new(PendingScrapeResponses::default()));
|
||||
|
||||
// Periodically clean pending_scrape_responses
|
||||
TimerActionRepeat::repeat(enclose!((config, pending_scrape_responses) move || {
|
||||
enclose!((config, pending_scrape_responses) move || async move {
|
||||
TimerActionRepeat::repeat(enclose!((pending_scrape_responses) move || {
|
||||
enclose!((pending_scrape_responses) move || async move {
|
||||
pending_scrape_responses.borrow_mut().clean();
|
||||
|
||||
Some(Duration::from_secs(config.cleaning.interval))
|
||||
Some(Duration::from_secs(120))
|
||||
})()
|
||||
}));
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ async fn read_requests(
|
|||
enclose!((config, connections) move || async move {
|
||||
connections.borrow_mut().clean();
|
||||
|
||||
Some(Duration::from_secs(config.cleaning.interval))
|
||||
Some(Duration::from_secs(config.cleaning.connection_cleaning_interval))
|
||||
})()
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue