Skip to content

Commit

Permalink
rename fd_budget fn to try_set_fd_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Nov 24, 2023
1 parent c471bb9 commit 7b74a7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kaspad/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn main() {

let args = parse_args();

match fd_budget::ensure_os_limits(DESIRED_DAEMON_SOFT_FD_LIMIT) {
match fd_budget::try_set_fd_limit(DESIRED_DAEMON_SOFT_FD_LIMIT) {
Ok(limit) => {
if limit < MINIMUM_DAEMON_SOFT_FD_LIMIT {
println!("Current OS file descriptor limit (soft FD limit) is set to {limit}");
Expand Down
2 changes: 1 addition & 1 deletion utils/src/fd_budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn acquire_guard(value: i32) -> Result<FDGuard, Error> {
}

#[cfg(not(target_arch = "wasm32"))]
pub fn ensure_os_limits(limit: u64) -> std::io::Result<u64> {
pub fn try_set_fd_limit(limit: u64) -> std::io::Result<u64> {
cfg_if::cfg_if! {
if #[cfg(target_os = "windows")] {
Ok(rlimit::setmaxstdio(limit as u32)?.map(|v| v as u64))
Expand Down

0 comments on commit 7b74a7e

Please sign in to comment.