Removed unused syscall in /about API. Closes #1421, closes #1422.

Co-authored-by: Gabriel Vasile <gabriel.vasile@email.com>
This commit is contained in:
Kailash Nadh 2023-08-03 23:46:46 +05:30
parent e89b9ffb30
commit dcb87a39b7

View file

@ -2,7 +2,6 @@ package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"regexp"
@ -295,19 +294,13 @@ func handleTestSMTPSettings(c echo.Context) error {
}
func handleGetAboutInfo(c echo.Context) error {
app := c.Get("app").(*App)
var (
mem runtime.MemStats
utsname syscall.Utsname
app = c.Get("app").(*App)
mem runtime.MemStats
)
runtime.ReadMemStats(&mem)
if err := syscall.Uname(&utsname); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Errorf("error getting system info: %v", err))
}
out := app.about
out.System.AllocMB = mem.Alloc / 1024 / 1024
out.System.OSMB = mem.Sys / 1024 / 1024