split up librqbit torrent state into smaller files

This commit is contained in:
Igor Katson 2023-11-23 16:27:55 +00:00
parent 7cd6102c6a
commit edaf3e0997
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
17 changed files with 502 additions and 440 deletions

View file

@ -11,7 +11,6 @@ use librqbit::{
Session, SessionOptions,
},
spawn_utils::{spawn, BlockingSpawner},
torrent_state::timeit,
};
use size_format::SizeFormatterBinary as SF;
use tracing::{error, info, span, warn, Level};
@ -244,7 +243,7 @@ async fn async_main(opts: Opts, spawner: BlockingSpawner) -> anyhow::Result<()>
info!("[{}] initializing", idx);
},
ManagedTorrentState::Running(handle) => {
let stats = timeit("stats_snapshot", || handle.torrent_state().stats_snapshot());
let stats = handle.torrent_state().stats_snapshot();
let speed = handle.speed_estimator();
let total = stats.total_bytes;
let progress = stats.total_bytes - stats.remaining_bytes;