Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit c6faac2

Browse files
authored
Up soft rlimit (#1185)
* check for low soft limit * remove hard limit check
1 parent 5dd9892 commit c6faac2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

apps/desktop/src-tauri/src/qdrant.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,20 @@ impl Drop for QdrantSupervisor {
129129
#[cfg(unix)]
130130
fn run_command(command: &Path, qdrant_dir: &Path, stdout: &Path, stderr: &Path) -> Child {
131131
use nix::sys::resource::{getrlimit, setrlimit, Resource};
132-
use tracing::info;
133132

134133
let logs_file = File::create(stdout).unwrap();
135134
let stderr_logs_file = File::create(stderr).unwrap();
136135

137136
match getrlimit(Resource::RLIMIT_NOFILE) {
138-
Ok((current_soft, current_hard)) if current_hard < 10000 => {
139-
if let Err(err) = setrlimit(Resource::RLIMIT_NOFILE, 10000, 10000) {
137+
Ok((current_soft, current_hard)) => {
138+
let new_soft = current_hard.min(10000);
139+
if let Err(err) = setrlimit(Resource::RLIMIT_NOFILE, new_soft, current_hard) {
140140
error!(
141141
?err,
142-
new_soft = 10000,
143-
new_hard = 10000,
144-
current_soft,
145-
current_hard,
146-
"failed to set rlimit/nofile"
142+
new_soft, current_soft, current_hard, "failed to set rlimit/nofile"
147143
);
148144
}
149145
}
150-
Ok((current_soft, current_hard)) => {
151-
info!(current_soft, current_hard, "no change to rlimit needed");
152-
}
153146
Err(err) => {
154147
error!(?err, "failed to get rlimit/nofile");
155148
}

0 commit comments

Comments
 (0)