mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-06 20:29:10 -07:00
global: snapshot
This commit is contained in:
5
crates/brk_core/src/utils/mod.rs
Normal file
5
crates/brk_core/src/utils/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
mod pause;
|
||||
mod rlimit;
|
||||
|
||||
pub use pause::*;
|
||||
pub use rlimit::*;
|
||||
7
crates/brk_core/src/utils/pause.rs
Normal file
7
crates/brk_core/src/utils/pause.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use log::info;
|
||||
|
||||
pub fn pause() {
|
||||
info!("Press enter to continue...");
|
||||
let mut buffer = String::new();
|
||||
std::io::stdin().read_line(&mut buffer).expect("Failed to read line");
|
||||
}
|
||||
10
crates/brk_core/src/utils/rlimit.rs
Normal file
10
crates/brk_core/src/utils/rlimit.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use std::io;
|
||||
|
||||
use rlimit::{Resource, getrlimit};
|
||||
|
||||
pub fn setrlimit() -> io::Result<()> {
|
||||
let no_file_limit = getrlimit(Resource::NOFILE)?;
|
||||
rlimit::setrlimit(Resource::NOFILE, no_file_limit.0.max(210_000), no_file_limit.1)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user