mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-03 03:05:31 +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
|
|
@ -141,7 +141,9 @@ pub fn run_inner(config: Config, state: State) -> ::anyhow::Result<()> {
|
|||
.unwrap();
|
||||
|
||||
loop {
|
||||
::std::thread::sleep(Duration::from_secs(config.cleaning.interval));
|
||||
::std::thread::sleep(Duration::from_secs(
|
||||
config.cleaning.torrent_cleaning_interval,
|
||||
));
|
||||
|
||||
state.torrents.lock().clean(&config, &state.access_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,9 @@ pub fn run_socket_worker(
|
|||
if iter_counter % 32 == 0 {
|
||||
let now = Instant::now();
|
||||
|
||||
if last_cleaning + Duration::from_secs(config.cleaning.interval) > now {
|
||||
if last_cleaning + Duration::from_secs(config.cleaning.connection_cleaning_interval)
|
||||
> now
|
||||
{
|
||||
connections.clean();
|
||||
|
||||
last_cleaning = now;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue