mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-06 12:55:24 +02:00
Fix startup failure from fd exhaustion when launched via Finder (#500)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,9 @@ tauri-build = { version = "2.6.1", features = [] }
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
openssl-sys = { version = "0.9.105", features = ["vendored"] } # For Ubuntu installation to work
|
||||
|
||||
[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies]
|
||||
rlimit = "0.11" # Raise the launchd 256 open-file soft limit at startup
|
||||
|
||||
[dependencies]
|
||||
charset = "0.1.5"
|
||||
chrono = { workspace = true, features = ["serde"] }
|
||||
|
||||
@@ -1676,6 +1676,14 @@ async fn cmd_check_for_updates<R: Runtime>(
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
#[cfg_attr(feature = "cef", tauri::cef_entry_point)]
|
||||
pub fn run() {
|
||||
// GUI apps launched via Finder/launchd inherit a 256 open-file soft limit on macOS
|
||||
// (1024 on most Linux desktops). SQLite WAL connections hold ~3 fds each, so raise
|
||||
// the limit toward the hard cap before opening any DB pools.
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
if let Err(e) = rlimit::increase_nofile_limit(10240) {
|
||||
eprintln!("Failed to raise open-file limit: {e}");
|
||||
}
|
||||
|
||||
let mut builder = tauri::Builder::<TauriRuntime>::default().plugin(
|
||||
Builder::default()
|
||||
.targets([
|
||||
|
||||
Reference in New Issue
Block a user