Add --experimental-mmap-storage
This commit is contained in:
parent
ed05ffc6f7
commit
79a523f2fe
1 changed files with 10 additions and 0 deletions
|
|
@ -7,11 +7,15 @@ use librqbit::{
|
||||||
api::ApiAddTorrentResponse,
|
api::ApiAddTorrentResponse,
|
||||||
http_api::{HttpApi, HttpApiOptions},
|
http_api::{HttpApi, HttpApiOptions},
|
||||||
http_api_client, librqbit_spawn,
|
http_api_client, librqbit_spawn,
|
||||||
|
<<<<<<< HEAD
|
||||||
storage::{
|
storage::{
|
||||||
filesystem::FilesystemStorageFactory,
|
filesystem::FilesystemStorageFactory,
|
||||||
middleware::{slow::SlowStorageFactory, timing::TimingStorageFactory},
|
middleware::{slow::SlowStorageFactory, timing::TimingStorageFactory},
|
||||||
StorageFactoryExt,
|
StorageFactoryExt,
|
||||||
},
|
},
|
||||||
|
=======
|
||||||
|
storage::mmap::MmapStorageFactory,
|
||||||
|
>>>>>>> a557afc (Add --experimental-mmap-storage)
|
||||||
tracing_subscriber_config_utils::{init_logging, InitLoggingOptions},
|
tracing_subscriber_config_utils::{init_logging, InitLoggingOptions},
|
||||||
AddTorrent, AddTorrentOptions, AddTorrentResponse, Api, ListOnlyResponse,
|
AddTorrent, AddTorrentOptions, AddTorrentResponse, Api, ListOnlyResponse,
|
||||||
PeerConnectionOptions, Session, SessionOptions, TorrentStatsState,
|
PeerConnectionOptions, Session, SessionOptions, TorrentStatsState,
|
||||||
|
|
@ -108,6 +112,10 @@ struct Opts {
|
||||||
/// Might be useful if the disk is slow.
|
/// Might be useful if the disk is slow.
|
||||||
#[arg(long = "defer-writes", default_value = "false")]
|
#[arg(long = "defer-writes", default_value = "false")]
|
||||||
defer_writes: bool,
|
defer_writes: bool,
|
||||||
|
|
||||||
|
/// Use mmap (file-backed) for storage.
|
||||||
|
#[arg(long)]
|
||||||
|
experimental_mmap_storage: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
|
@ -393,11 +401,13 @@ async fn async_main(opts: Opts) -> anyhow::Result<()> {
|
||||||
sub_folder: download_opts.sub_folder.clone(),
|
sub_folder: download_opts.sub_folder.clone(),
|
||||||
initial_peers: download_opts.initial_peers.clone().map(|p| p.0),
|
initial_peers: download_opts.initial_peers.clone().map(|p| p.0),
|
||||||
disable_trackers: download_opts.disable_trackers,
|
disable_trackers: download_opts.disable_trackers,
|
||||||
|
|
||||||
storage_factory: Some({
|
storage_factory: Some({
|
||||||
let sf = FilesystemStorageFactory::default();
|
let sf = FilesystemStorageFactory::default();
|
||||||
let sf = SlowStorageFactory::new(sf);
|
let sf = SlowStorageFactory::new(sf);
|
||||||
TimingStorageFactory::new("fs".to_owned(), sf).boxed()
|
TimingStorageFactory::new("fs".to_owned(), sf).boxed()
|
||||||
}),
|
}),
|
||||||
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let connect_to_existing = match client.validate_rqbit_server().await {
|
let connect_to_existing = match client.validate_rqbit_server().await {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue