This repository was archived by the owner on Jan 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
apps/desktop/src-tauri/src Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -129,27 +129,20 @@ impl Drop for QdrantSupervisor {
129
129
#[ cfg( unix) ]
130
130
fn run_command ( command : & Path , qdrant_dir : & Path , stdout : & Path , stderr : & Path ) -> Child {
131
131
use nix:: sys:: resource:: { getrlimit, setrlimit, Resource } ;
132
- use tracing:: info;
133
132
134
133
let logs_file = File :: create ( stdout) . unwrap ( ) ;
135
134
let stderr_logs_file = File :: create ( stderr) . unwrap ( ) ;
136
135
137
136
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) {
140
140
error ! (
141
141
?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"
147
143
) ;
148
144
}
149
145
}
150
- Ok ( ( current_soft, current_hard) ) => {
151
- info ! ( current_soft, current_hard, "no change to rlimit needed" ) ;
152
- }
153
146
Err ( err) => {
154
147
error ! ( ?err, "failed to get rlimit/nofile" ) ;
155
148
}
You can’t perform that action at this time.
0 commit comments