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
@@ -2,6 +2,7 @@ package service
import (
"os"
"runtime"
"s-ui/logger"
"syscall"
"time"
@@ -17,7 +18,11 @@ func (s *PanelService) RestartPanel(delay time.Duration) error {
}
go func() {
time.Sleep(delay)
err := p.Signal(syscall.SIGHUP)
if runtime.GOOS == "windows" {
err = p.Kill()
} else {
err = p.Signal(syscall.SIGHUP)
}
if err != nil {
logger.Error("send signal SIGHUP failed:", err)
}
+4
View File
@@ -3,6 +3,7 @@ package service
import (
"encoding/json"
"os"
"runtime"
"s-ui/config"
"s-ui/database"
"s-ui/database/model"
@@ -245,6 +246,9 @@ func (s *SettingService) GetTimeLocation() (*time.Location, error) {
if err != nil {
return nil, err
}
if runtime.GOOS == "windows" {
l = "Local"
}
location, err := time.LoadLocation(l)
if err != nil {
defaultLocation := defaultValueMap["timeLocation"]