Only set gc percent if the flag is set (#4899)

* only set gc percent if the flag is set
This commit is contained in:
Preston Van Loon
2020-02-17 17:37:35 -08:00
committed by GitHub
parent c7d0ced5d1
commit 40afef8b9e

View File

@@ -127,7 +127,9 @@ func main() {
}
}
runtimeDebug.SetGCPercent(ctx.GlobalInt(flags.SetGCPercent.Name))
if ctx.IsSet(flags.SetGCPercent.Name) {
runtimeDebug.SetGCPercent(ctx.GlobalInt(flags.SetGCPercent.Name))
}
runtime.GOMAXPROCS(runtime.NumCPU())
return debug.Setup(ctx)
}