diff --git a/server/utils/applyResourceLimits.go b/config/applyResourceLimits.go similarity index 99% rename from server/utils/applyResourceLimits.go rename to config/applyResourceLimits.go index 022db6d..50755ba 100644 --- a/server/utils/applyResourceLimits.go +++ b/config/applyResourceLimits.go @@ -1,4 +1,4 @@ -package utils +package config import ( "log" diff --git a/main.go b/main.go index 36780a8..04ac759 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ func main() { log.Fatal("Error loading config: ", err) } - utils.ApplyResourceLimits(&cfg.ResourceLimits) // Apply limits once before starting the server + config.ApplyResourceLimits(&cfg.ResourceLimits) // Apply limits once before starting the server client, err := db.InitDB(cfg) if err != nil { diff --git a/server/handlers/event.go b/server/handlers/event.go index 22ebe84..4e2094d 100644 --- a/server/handlers/event.go +++ b/server/handlers/event.go @@ -16,7 +16,7 @@ import ( ) func HandleEvent(ws *websocket.Conn, message []interface{}) { - utils.LimitedGoRoutine(func() { + config.LimitedGoRoutine(func() { if len(message) != 2 { fmt.Println("Invalid EVENT message format") response.SendNotice(ws, "", "Invalid EVENT message format") diff --git a/server/handlers/req.go b/server/handlers/req.go index 123769d..743b90a 100644 --- a/server/handlers/req.go +++ b/server/handlers/req.go @@ -17,7 +17,7 @@ var subscriptions = make(map[string]relay.Subscription) var mu sync.Mutex // Protect concurrent access to subscriptions map func HandleReq(ws *websocket.Conn, message []interface{}, subscriptions map[string][]relay.Filter) { - utils.LimitedGoRoutine(func() { + config.LimitedGoRoutine(func() { if len(message) < 3 { fmt.Println("Invalid REQ message format") response.SendClosed(ws, "", "invalid: invalid REQ message format")