Limit tokio threads
This commit is contained in:
parent
7f47772dcb
commit
b3d347e2b6
1 changed files with 4 additions and 3 deletions
|
|
@ -59,15 +59,16 @@ struct Opts {
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
|
|
||||||
|
let opts = Opts::parse();
|
||||||
|
|
||||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||||
.enable_all()
|
.enable_time()
|
||||||
|
.enable_io()
|
||||||
// the default is 512, it can get out of hand.
|
// the default is 512, it can get out of hand.
|
||||||
.max_blocking_threads(8)
|
.max_blocking_threads(8)
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
rt.block_on(async move {
|
rt.block_on(async move {
|
||||||
let opts = Opts::parse();
|
|
||||||
|
|
||||||
let torrent = if opts.torrent_path.starts_with("http://")
|
let torrent = if opts.torrent_path.starts_with("http://")
|
||||||
|| opts.torrent_path.starts_with("https://")
|
|| opts.torrent_path.starts_with("https://")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue