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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user