2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

fix: lint

This commit is contained in:
2025-04-12 05:57:26 +08:00
parent 3b7bf35bf3
commit 137665b77d
2 changed files with 4 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ func (s *App) UpdateConfig(w http.ResponseWriter, r *http.Request) {
}
if err = systemctl.Restart("mysqld"); err != nil {
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to restart MySQL: %v"), err)
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to restart MySQL: %v", err))
return
}

View File

@@ -62,7 +62,7 @@ func (s *App) SaveConfig(w http.ResponseWriter, r *http.Request) {
if err = systemctl.Reload("nginx"); err != nil {
_, err = shell.Execf("nginx -t")
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to reload nginx: %v"), err)
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to reload nginx: %v", err))
return
}
@@ -95,7 +95,7 @@ func (s *App) Load(w http.ResponseWriter, r *http.Request) {
workers, err := shell.Execf("ps aux | grep nginx | grep 'worker process' | wc -l")
if err != nil {
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get nginx workers: %v"), err)
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get nginx workers: %v", err))
return
}
data = append(data, types.NV{
@@ -105,7 +105,7 @@ func (s *App) Load(w http.ResponseWriter, r *http.Request) {
out, err := shell.Execf("ps aux | grep nginx | grep 'worker process' | awk '{memsum+=$6};END {print memsum}'")
if err != nil {
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get nginx workers: %v"), err)
service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get nginx workers: %v", err))
return
}
mem := tools.FormatBytes(cast.ToFloat64(out))