mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-03 10:31:28 -05:00
refactor: align platform crate boundaries
This commit is contained in:
1 parent
aa1bcaa2eb
commit
6250ca4e98
43 files changed
+1004
-1004
No files matched your search
@@ -10,5 +10,13 @@ pub use windows::{
|
||||
|
||||
/// Deterministic worker-thread cap shared by filesystem scanning and engines.
|
||||
pub fn thread_cap() -> usize {
|
||||
windows::thread_cap()
|
||||
if let Ok(value) = std::env::var("SENBEI_THREADS")
|
||||
&& let Ok(count) = value.trim().parse::<usize>()
|
||||
&& count >= 1
|
||||
{
|
||||
return count;
|
||||
}
|
||||
std::thread::available_parallelism()
|
||||
.map(|count| count.get())
|
||||
.unwrap_or(1)
|
||||
}
|
||||
Reference in new issue
Block a user