Skip to content

Commit

Permalink
Removed unused syscall in /about API. Closes #1421, closes #1422.
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Vasile <[email protected]>
  • Loading branch information
knadh and gabriel-vasile committed Aug 3, 2023
1 parent e89b9ff commit dcb87a3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"regexp"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dcb87a3

Please sign in to comment.