Fastresume CLI option
This commit is contained in:
parent
e11744cd63
commit
65feec3406
3 changed files with 8 additions and 2 deletions
2
Makefile
2
Makefile
|
|
@ -20,7 +20,7 @@ devserver:
|
||||||
echo -n '' > /tmp/rqbit-log && cargo run -- \
|
echo -n '' > /tmp/rqbit-log && cargo run -- \
|
||||||
--log-file /tmp/rqbit-log \
|
--log-file /tmp/rqbit-log \
|
||||||
--log-file-rust-log=debug,librqbit=trace \
|
--log-file-rust-log=debug,librqbit=trace \
|
||||||
server start /tmp/scratch/
|
server start --fastresume /tmp/scratch/
|
||||||
|
|
||||||
@PHONY: devserver
|
@PHONY: devserver
|
||||||
devserver-postgres:
|
devserver-postgres:
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ impl TorrentStateLocked {
|
||||||
if self.unflushed_bitv_bytes == 0 {
|
if self.unflushed_bitv_bytes == 0 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
trace!("trying to flush bitfield");
|
||||||
if let Some(Err(e)) = self
|
if let Some(Err(e)) = self
|
||||||
.chunks
|
.chunks
|
||||||
.as_mut()
|
.as_mut()
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,10 @@ struct ServerStartOptions {
|
||||||
/// The folder to store session data in. By default uses OS specific folder.
|
/// The folder to store session data in. By default uses OS specific folder.
|
||||||
#[arg(long = "persistence-config")]
|
#[arg(long = "persistence-config")]
|
||||||
persistence_config: Option<String>,
|
persistence_config: Option<String>,
|
||||||
|
|
||||||
|
/// [Experimental] if set, will try to resume quickly after restart and skip checksumming.
|
||||||
|
#[arg(long = "fastresume")]
|
||||||
|
fastresume: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
|
@ -422,6 +426,8 @@ async fn async_main(opts: Opts) -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sopts.fastresume = start_opts.fastresume;
|
||||||
|
|
||||||
let session =
|
let session =
|
||||||
Session::new_with_opts(PathBuf::from(&start_opts.output_folder), sopts)
|
Session::new_with_opts(PathBuf::from(&start_opts.output_folder), sopts)
|
||||||
.await
|
.await
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue