From 0ab753bb2c122b34b17fedfb4a751f6c5f6231c0 Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Thu, 5 Sep 2024 11:04:12 -0400 Subject: [PATCH] refactor resource limit function --- config/{applyResourceLimits.go => setResourceLimit.go} | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename config/{applyResourceLimits.go => setResourceLimit.go} (97%) diff --git a/config/applyResourceLimits.go b/config/setResourceLimit.go similarity index 97% rename from config/applyResourceLimits.go rename to config/setResourceLimit.go index 50755ba..a95da88 100644 --- a/config/applyResourceLimits.go +++ b/config/setResourceLimit.go @@ -17,7 +17,7 @@ var ( goroutineQueueMutex sync.Mutex ) -func ApplyResourceLimits(cfg *configTypes.ResourceLimits) { +func SetResourceLimit(cfg *configTypes.ResourceLimits) { // Set CPU cores runtime.GOMAXPROCS(cfg.CPUCores) diff --git a/main.go b/main.go index 5280614..2db3fd6 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ func main() { log.Fatal("Error loading config: ", err) } - config.ApplyResourceLimits(&cfg.ResourceLimits) // Apply limits once before starting the server + config.SetResourceLimit(&cfg.ResourceLimits) // Apply limits once before starting the server client, err := db.InitDB(cfg) if err != nil {