ci cross-platform fix: avoid syscall.SIGHUP usage on windows via build-tagged self-reload helper

This commit is contained in:
DBT
2026-03-01 12:49:58 +00:00
parent 61d445318b
commit 618a8a3723
3 changed files with 21 additions and 2 deletions

View File

@@ -19,7 +19,6 @@ import (
"strconv"
"strings"
"sync"
"syscall"
"time"
cfgpkg "clawgo/pkg/config"
@@ -357,7 +356,7 @@ func (s *RegistryServer) handleWebUIConfig(w http.ResponseWriter, r *http.Reques
if s.onConfigAfter != nil {
s.onConfigAfter()
} else {
_ = syscall.Kill(os.Getpid(), syscall.SIGHUP)
_ = requestSelfReloadSignal()
}
_ = json.NewEncoder(w).Encode(map[string]interface{}{"ok": true, "reloaded": true})
default:

12
pkg/nodes/reload_unix.go Normal file
View File

@@ -0,0 +1,12 @@
//go:build !windows
package nodes
import (
"os"
"syscall"
)
func requestSelfReloadSignal() error {
return syscall.Kill(os.Getpid(), syscall.SIGHUP)
}

View File

@@ -0,0 +1,8 @@
//go:build windows
package nodes
// requestSelfReloadSignal is a no-op on Windows (no SIGHUP semantics).
func requestSelfReloadSignal() error {
return nil
}