From f5db7d993f86350f486801c36824e027ae93fa9d Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 6 Nov 2023 08:28:33 +0800 Subject: [PATCH] feat: raise open file descriptors limit at startup --- Cargo.lock | 10 ++++++++++ yazi-fm/Cargo.toml | 1 + yazi-fm/src/main.rs | 1 + 3 files changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index fa7939fd..3216adf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,6 +578,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "fdlimit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +dependencies = [ + "libc", +] + [[package]] name = "filetime" version = "0.2.22" @@ -2517,6 +2526,7 @@ dependencies = [ "ansi-to-tui", "anyhow", "crossterm", + "fdlimit", "futures", "libc", "ratatui", diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 9bd1b367..b3fc37e3 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -19,6 +19,7 @@ yazi-shared = { path = "../yazi-shared", version = "0.1.5" } ansi-to-tui = "^3" anyhow = "^1" crossterm = { version = "^0", features = [ "event-stream" ] } +fdlimit = "^0" futures = "^0" ratatui = "^0" tokio = { version = "^1", features = [ "parking_lot" ] } diff --git a/yazi-fm/src/main.rs b/yazi-fm/src/main.rs index 3690dff0..3b82be85 100644 --- a/yazi-fm/src/main.rs +++ b/yazi-fm/src/main.rs @@ -20,6 +20,7 @@ use signals::*; #[tokio::main] async fn main() -> anyhow::Result<()> { + let _ = fdlimit::raise_fd_limit(); // console_subscriber::init(); yazi_config::init();