summaryrefslogtreecommitdiff
path: root/cli/main_runtime.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_runtime.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_runtime.rs')
-rw-r--r--cli/main_runtime.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/main_runtime.rs b/cli/main_runtime.rs
index db3f9fd02..23f1c23b6 100644
--- a/cli/main_runtime.rs
+++ b/cli/main_runtime.rs
@@ -5,6 +5,7 @@
mod colors;
mod standalone;
mod tokio_util;
+mod unix_util;
mod version;
use deno_core::error::anyhow;
@@ -14,6 +15,7 @@ use std::env;
pub fn main() {
#[cfg(windows)]
colors::enable_ansi(); // For Windows 10
+ unix_util::raise_fd_limit();
let args: Vec<String> = env::args().collect();
if let Err(err) = run(args) {