remove not use function and func

update submodule
This commit is contained in:
Jay 2019-03-07 14:42:42 +08:00
parent 75105e4cf7
commit c44547573a
2 changed files with 1 additions and 27 deletions

26
main.go
View File

@ -7,10 +7,8 @@ import (
"log" "log"
"os" "os"
"path" "path"
"runtime"
"strconv" "strconv"
"strings" "strings"
"time"
"git.trj.tw/golang/mtfosbot/module/apis/twitch" "git.trj.tw/golang/mtfosbot/module/apis/twitch"
"git.trj.tw/golang/mtfosbot/module/cmd" "git.trj.tw/golang/mtfosbot/module/cmd"
@ -80,33 +78,9 @@ func main() {
log.Fatal(errors.New("log image root not exists")) log.Fatal(errors.New("log image root not exists"))
} }
go func() {
for {
PrintMemUsage()
time.Sleep(time.Second * 20)
}
}()
server.Run(strings.Join([]string{":", strconv.Itoa(config.GetConf().Port)}, "")) server.Run(strings.Join([]string{":", strconv.Itoa(config.GetConf().Port)}, ""))
} }
// PrintMemUsage -
func PrintMemUsage() {
var m runtime.MemStats
runtime.ReadMemStats(&m)
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
// fmt.Printf("Alloc = %v MiB", bToMb(m.Alloc))
// fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc))
// fmt.Printf("\tSys = %v MiB", bToMb(m.Sys))
// fmt.Printf("\tNumGC = %v\n", m.NumGC)
// fmt.Printf("HeapAlloc = %v MiB", bToMb(m.HeapAlloc))
// fmt.Printf("\t HeapSys = %v MiB", bToMb(m.HeapSys))
// fmt.Printf("\t NextGC = %v MiB\n", bToMb(m.NextGC))
}
func bToMb(b uint64) uint64 {
return b / 1024 / 1024
}
func registerTypes() { func registerTypes() {
gob.Register(model.Account{}) gob.Register(model.Account{})
gob.Register(model.Commands{}) gob.Register(model.Commands{})

2
schema

@ -1 +1 @@
Subproject commit 899a2fb0f252bbb1e784e00805a2bef7545f9316 Subproject commit bda09929578505cd4712856bee125b9838643d78