|
@@ -701,24 +701,22 @@ func initBounceManager(app *App) *bounce.Manager {
|
|
|
|
|
|
func initAbout(q *models.Queries, db *sqlx.DB) about {
|
|
func initAbout(q *models.Queries, db *sqlx.DB) about {
|
|
var (
|
|
var (
|
|
- mem runtime.MemStats
|
|
|
|
- utsname syscall.Utsname
|
|
|
|
|
|
+ mem runtime.MemStats
|
|
)
|
|
)
|
|
|
|
|
|
// Memory / alloc stats.
|
|
// Memory / alloc stats.
|
|
runtime.ReadMemStats(&mem)
|
|
runtime.ReadMemStats(&mem)
|
|
|
|
|
|
- // OS info.
|
|
|
|
- if err := syscall.Uname(&utsname); err != nil {
|
|
|
|
- lo.Printf("WARNING: error getting system info: %v", err)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // DB dbv.
|
|
|
|
info := types.JSONText(`{}`)
|
|
info := types.JSONText(`{}`)
|
|
if err := db.QueryRow(q.GetDBInfo).Scan(&info); err != nil {
|
|
if err := db.QueryRow(q.GetDBInfo).Scan(&info); err != nil {
|
|
lo.Printf("WARNING: error getting database version: %v", err)
|
|
lo.Printf("WARNING: error getting database version: %v", err)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ hostname, err := os.Hostname()
|
|
|
|
+ if err != nil {
|
|
|
|
+ lo.Printf("WARNING: error getting hostname: %v", err)
|
|
|
|
+ }
|
|
|
|
+
|
|
return about{
|
|
return about{
|
|
Version: versionString,
|
|
Version: versionString,
|
|
Build: buildString,
|
|
Build: buildString,
|
|
@@ -729,10 +727,9 @@ func initAbout(q *models.Queries, db *sqlx.DB) about {
|
|
NumCPU: runtime.NumCPU(),
|
|
NumCPU: runtime.NumCPU(),
|
|
},
|
|
},
|
|
Host: aboutHost{
|
|
Host: aboutHost{
|
|
- OS: int8ToStr(utsname.Sysname[:]),
|
|
|
|
- OSRelease: int8ToStr(utsname.Release[:]),
|
|
|
|
- Machine: int8ToStr(utsname.Machine[:]),
|
|
|
|
- Hostname: int8ToStr(utsname.Nodename[:]),
|
|
|
|
|
|
+ OS: runtime.GOOS,
|
|
|
|
+ Machine: runtime.GOARCH,
|
|
|
|
+ Hostname: hostname,
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
|