mirror of
https://github.com/SinTan1729/privtracker.git
synced 2024-12-25 06:58:37 -06:00
garbage collect during cleanup
This commit is contained in:
parent
5e49ae530c
commit
58670ea7a7
5 changed files with 7 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
privtracker
|
||||
config.json
|
||||
dist
|
||||
*.fiber.gz
|
||||
|
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module privtracker
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/gofiber/fiber/v2 v2.29.0
|
||||
github.com/gofiber/fiber/v2 v2.30.0
|
||||
github.com/jackpal/bencode-go v1.0.0
|
||||
github.com/klauspost/compress v1.15.1 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1,7 +1,7 @@
|
|||
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/gofiber/fiber/v2 v2.29.0 h1:wopU1kXxdD9XxvQqYd1vSWMGu2PiZN0yy+DojygTRRA=
|
||||
github.com/gofiber/fiber/v2 v2.29.0/go.mod h1:1Ega6O199a3Y7yDGuM9FyXDPYQfv+7/y48wl6WCwUF4=
|
||||
github.com/gofiber/fiber/v2 v2.30.0 h1:R928kgJICQkcfIzAjMIQ+U0uOpa0+vTCZLLODeo4M14=
|
||||
github.com/gofiber/fiber/v2 v2.30.0/go.mod h1:1Ega6O199a3Y7yDGuM9FyXDPYQfv+7/y48wl6WCwUF4=
|
||||
github.com/jackpal/bencode-go v1.0.0 h1:lzbSPPqqSfWQnqVNe/BBY1NXdDpncArxShL10+fmFus=
|
||||
github.com/jackpal/bencode-go v1.0.0/go.mod h1:5FSBQ74yhCl5oQ+QxRPYzWMONFnxbL68/23eezsBI5c=
|
||||
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
|
|
1
main.go
1
main.go
|
@ -31,6 +31,7 @@ func main() {
|
|||
}
|
||||
app := fiber.New(config)
|
||||
app.Use(recover.New())
|
||||
// app.Use(pprof.New())
|
||||
app.Use(myLogger())
|
||||
app.Use(hsts)
|
||||
app.Get("/", docs)
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"crypto/sha1"
|
||||
"encoding/binary"
|
||||
"net"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -163,5 +164,6 @@ func Cleanup() {
|
|||
}
|
||||
shard.Unlock()
|
||||
}
|
||||
runtime.GC()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue