From 81bd7d9d76b193ad086cc5e6eddb4f275a727998 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Mon, 10 Aug 2026 20:21:34 +0800 Subject: [PATCH] macos: enable host-driven BEAM restart in host-first bundle Set the new [lifetime] INI keys (restart_beam, restart_max_attempts, restart_backoff_ms) when packaging the host-first DesktopWebView app. This activates the native host's child-exit watcher that replaces heart as the BEAM restart mechanism. Pairs with elixir-desktop/webview PR #4 which adds the watcher and keys. The Erlang release generated by this packaging does not need -heart; the host is the long-lived process. Co-Authored-By: Claude Co-authored-by: Cursor --- lib/package/macos.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/package/macos.ex b/lib/package/macos.ex index 15d5db7..b2a1037 100644 --- a/lib/package/macos.ex +++ b/lib/package/macos.ex @@ -59,6 +59,13 @@ defmodule Desktop.Deployment.Package.MacOS do [lifetime] mode = reconnect + # Host-driven BEAM restart (replaces the heart watchdog). The native + # DesktopWebView host watches its child BEAM process and respawns it on + # any exit; `system.prepare_quit` from Elixir suppresses respawn during a + # user-initiated quit. The Erlang release does not need -heart here. + restart_beam = true + restart_max_attempts = 0 + restart_backoff_ms = 500 """ # Host binaries (e.g. DesktopWebView) look for .ini next to Resources.