summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2021-04-13 16:24:45 +0200
committerGitHub <noreply@github.com>2021-04-13 10:24:45 -0400
commitd46b37f6a8639e25ff54ea1e264cc7cebdd03be9 (patch)
treea6db53645ea981501acc1a977e40762beb45796c /cli/main.rs
parentdf49a8462caf1cf4eea5c9f386322dae5e14dc4f (diff)
feat(cli): raise file descriptor limit on startup (#10162)
Raise the soft limit to the hard limit when possible. This is similar to what Node.js does to avoid running into "out of file descriptors" errors too quickly. On most Linux systems, raises the limit from 1,024 to 1,048,576. On most macOS systems, raises the limit from 256 to 10,240. Fixes #10148.
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/main.rs b/cli/main.rs
index d8e893906..0005bb891 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -36,6 +36,7 @@ mod tokio_util;
mod tools;
mod tsc;
mod tsc_config;
+mod unix_util;
mod version;
use crate::file_fetcher::File;
@@ -1176,6 +1177,7 @@ fn unwrap_or_exit<T>(result: Result<T, AnyError>) -> T {
pub fn main() {
#[cfg(windows)]
colors::enable_ansi(); // For Windows 10
+ unix_util::raise_fd_limit();
let args: Vec<String> = env::args().collect();
let standalone_res = match standalone::extract_standalone(args.clone()) {