fix(restart): the self-relaunch waits for its parent's mutex

A database switch relaunches OpsLog, and the child regularly won the
race against the old instance's teardown — so following the app's own
instructions produced 'OpsLog is already running'. The relaunch now
passes --relaunch, which gets the same 20-second mutex patience the
post-update restart has always had. Opens the 0.27.6 block.
This commit is contained in:
2026-08-31 14:19:30 +02:00
parent 8790b98766
commit 68f0d68980
3 changed files with 23 additions and 7 deletions
+3 -1
View File
@@ -2851,7 +2851,9 @@ func (a *App) RestartApp() error {
if err != nil {
return fmt.Errorf("locate executable: %w", err)
}
cmd := exec.Command(exe)
// --relaunch: the child waits for OUR mutex instead of declaring us a
// duplicate — this instance is quitting, just not always fast enough.
cmd := exec.Command(exe, "--relaunch")
cmd.Dir = filepath.Dir(exe)
if err := cmd.Start(); err != nil {
return fmt.Errorf("relaunch OpsLog: %w", err)