fix build for windows

This commit is contained in:
Alireza Ahmadi
2025-08-21 00:47:09 +02:00
parent 7bc7468cf3
commit 123813dc90
5 changed files with 122 additions and 49 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ import (
"mime/multipart"
"os"
"path/filepath"
"runtime"
"s-ui/cmd/migration"
"s-ui/config"
"s-ui/database/model"
@@ -287,7 +288,11 @@ func SendSighup() error {
// Send SIGHUP to the current process
go func() {
time.Sleep(3 * time.Second)
err := process.Signal(syscall.SIGHUP)
if runtime.GOOS == "windows" {
err = process.Kill()
} else {
err = process.Signal(syscall.SIGHUP)
}
if err != nil {
logger.Error("send signal SIGHUP failed:", err)
}