mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-29 15:36:28 +08:00
added gc
This commit is contained in:
parent
fef3f5e206
commit
8834ad4cf5
1 changed files with 9 additions and 0 deletions
9
main.go
9
main.go
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
|
@ -30,6 +31,7 @@ import (
|
|||
func main() {
|
||||
fmt.Println(models.RetrieveLogo()) // print the logo
|
||||
initialize() // initial db and grpc server
|
||||
setGarbageCollection()
|
||||
defer database.CloseDB()
|
||||
startControllers() // start the grpc or rest endpoints
|
||||
}
|
||||
|
|
@ -193,6 +195,13 @@ func authServerUnaryInterceptor() grpc.ServerOption {
|
|||
return grpc.UnaryInterceptor(controller.AuthServerUnaryInterceptor)
|
||||
}
|
||||
|
||||
func setGarbageCollection() {
|
||||
_, gcset := os.LookupEnv("GOGC")
|
||||
if !gcset {
|
||||
debug.SetGCPercent(ncutils.DEFAULT_GC_PERCENT)
|
||||
}
|
||||
}
|
||||
|
||||
// func authServerStreamInterceptor() grpc.ServerOption {
|
||||
// return grpc.StreamInterceptor(controller.AuthServerStreamInterceptor)
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue