Fixed memory leak and made response instant

This commit is contained in:
Artyom Belousov 2019-05-12 11:25:46 +03:00
parent 3ee53b7ad1
commit c59d47326d
3 changed files with 12 additions and 4 deletions

View file

@ -4,10 +4,17 @@ import (
"github.com/flygrounder/mtg-price-vk/vk"
"github.com/gin-gonic/gin"
"math/rand"
"runtime"
"time"
)
func main() {
go (func() {
for {
time.Sleep(5 * time.Second)
println(runtime.NumGoroutine())
}
})()
rand.Seed(time.Now().UTC().UnixNano())
r := gin.Default()
r.POST("callback/message", vk.HandleMessage)