diff --git a/config-example.lua b/config-example.lua index cd6767e..95df3b5 100644 --- a/config-example.lua +++ b/config-example.lua @@ -6,7 +6,7 @@ server = { } runner = { - pool_size = GOMAXPROCS + pool_size = 0 -- 0 defaults to GOMAXPROCS } dirs = { diff --git a/core/utils/config/config.go b/core/utils/config/config.go index 3924cd3..4851433 100644 --- a/core/utils/config/config.go +++ b/core/utils/config/config.go @@ -126,7 +126,7 @@ func applyConfig(config *Config, values map[string]any) { // Apply runner settings if runnerTable, ok := values["runner"].(map[string]any); ok { - if v, ok := runnerTable["pool_size"].(float64); ok { + if v, ok := runnerTable["pool_size"].(float64); ok && v != 0 { config.Runner.PoolSize = int(v) } } diff --git a/main.go b/main.go index dbe2f3a..774e8d9 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "os" "os/signal" @@ -11,10 +12,13 @@ import ( ) func main() { + configPath := flag.String("config", "config.lua", "Path to configuration file") + flag.Parse() + logger.InitGlobalLogger(logger.LevelDebug, true, false) logger.Server("Moonshark is starting to prowl 🦈") - server, err := core.NewMoonshark("config.lua") + server, err := core.NewMoonshark(*configPath) if err != nil { logger.Fatal("Failed to initialize server: %v", err) }