Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Mar 7, 2024
1 parent 675f70c commit 6545a51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kr2r/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicUsize, Ordering};
extern crate libc;

#[cfg(unix)]
use libc::{getrlimit, rlimit, RLIMIT_NOFILE};

#[cfg(unix)]
pub fn get_file_limit() -> usize {
let mut limits = rlimit {
rlim_cur: 0, // 当前(软)限制
Expand All @@ -34,6 +36,11 @@ pub fn get_file_limit() -> usize {
}
}

#[cfg(windows)]
fn get_file_limit() -> usize {
8192
}

// 定义每批次处理的 Cell 数量
const BATCH_SIZE: usize = 81920;

Expand Down

0 comments on commit 6545a51

Please sign in to comment.