From a85ff4cbdd09878ad41da495fbf50dd2479227a0 Mon Sep 17 00:00:00 2001 From: intergrav Date: Sun, 28 Jun 2026 18:48:27 -0400 Subject: [PATCH] fix: serialize applyConfig, improve SIGKILL error message --- restic.go | 3 +++ tray.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/restic.go b/restic.go index 900ac15..d6b35f6 100644 --- a/restic.go +++ b/restic.go @@ -392,6 +392,9 @@ func exitCode(err error) int { func classifyError(err error, lastStderr string) (string, int) { code := exitCode(err) + if code == -1 && strings.Contains(err.Error(), "killed") { + return "Process terminated by system", code + } if code == 12 { return "Wrong password", code } diff --git a/tray.go b/tray.go index e3bdd25..c655845 100644 --- a/tray.go +++ b/tray.go @@ -174,6 +174,7 @@ func onReady() { sched := cron.New() var applyConfig func() + var applyMu sync.Mutex state.onBusyChanged = func(busy bool) { if busy { @@ -364,6 +365,8 @@ func onReady() { } applyConfig = func() { + applyMu.Lock() + defer applyMu.Unlock() if isAnyBusy() { cfg := loadConfig() profileMu.Lock() -- 2.51.2