logger.Fatal("Ping period value must be less than pong wait value",zap.Int("socket.ping_period_ms",mainConfig.GetSocket().PingPeriodMs),zap.Int("socket.pong_wait_ms",mainConfig.GetSocket().PongWaitMs))
}
ifmainConfig.GetRuntime().MinCount<0{
logger.Fatal("Minimum runtime instance count must be >= 0",zap.Int("runtime.min_count",mainConfig.GetRuntime().MinCount))
}
ifmainConfig.GetRuntime().MaxCount<1{
logger.Fatal("Maximum runtime instance count must be >= 1",zap.Int("runtime.max_count",mainConfig.GetRuntime().MaxCount))
logger.Fatal("Minimum runtime instance count must be less than or equal to maximum runtime instance count",zap.Int("runtime.min_count",mainConfig.GetRuntime().MinCount),zap.Int("runtime.max_count",mainConfig.GetRuntime().MaxCount))
}
// If the runtime path is not overridden, set it to `datadir/modules`.
ifmainConfig.GetRuntime().Path==""{
@@ -364,6 +373,8 @@ type RuntimeConfig struct {
Env[]string`yaml:"env" json:"env"`
Pathstring`yaml:"path" json:"path" usage:"Path for the server to scan for *.lua files."`
// `DoFile(..)` only parses and evaluates modules. Calling it multiple times, will load and eval the file multiple times.
// So to make sure that we only load and evaluate modules once, regardless of whether there is dependency between files, we load them all into `preload`.
// This is to make sure that modules are only loaded and evaluated once as `doFile()` does not (always) update _LOADED table.