Skip to content

Commit

Permalink
garbage collect during cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
meehow committed Nov 9, 2022
1 parent 5e49ae5 commit 58670ea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
privtracker
config.json
dist
*.fiber.gz
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/sha1"
"encoding/binary"
"net"
"runtime"
"sync"
"time"
)
Expand Down Expand Up @@ -163,5 +164,6 @@ func Cleanup() {
}
shard.Unlock()
}
runtime.GC()
}
}

0 comments on commit 58670ea

Please sign in to comment.