fix(lua): enable file watch by default for hot reload
EnableFileWatch was false by default (Go bool zero value) when global_settings was not configured. Now defaults to true to enable Lua script hot reload without server restart. Also fix indentation in init.go default value settings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
8f3c304837
commit
986ebdf207
@ -147,6 +147,9 @@ func initLuaEngine(luaCfg *config.LuaMiddlewareConfig) (*lua.LuaEngine, error) {
|
|||||||
if engineCfg.LStatePoolMaxSize == 0 {
|
if engineCfg.LStatePoolMaxSize == 0 {
|
||||||
engineCfg.LStatePoolMaxSize = 1000
|
engineCfg.LStatePoolMaxSize = 1000
|
||||||
}
|
}
|
||||||
|
// EnableFileWatch 默认启用(用于 Lua 脚本热更新)
|
||||||
|
// 由于 bool 零值是 false,当配置未设置时默认启用文件监控
|
||||||
|
engineCfg.EnableFileWatch = true
|
||||||
|
|
||||||
engine, err := lua.NewEngine(engineCfg)
|
engine, err := lua.NewEngine(engineCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user