diff --git a/internal/config/config.go b/internal/config/config.go index 52c7b28..ec09fc8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1403,9 +1403,6 @@ type LuaGlobalSettings struct { // CodeCacheSize 字节码缓存条目数 CodeCacheSize int `yaml:"code_cache_size"` - // EnableFileWatch 启用文件变更检测 - EnableFileWatch bool `yaml:"enable_file_watch"` - // MaxExecutionTime 单脚本最大执行时间 MaxExecutionTime time.Duration `yaml:"max_execution_time"` @@ -1413,11 +1410,14 @@ type LuaGlobalSettings struct { // 较小的栈减少内存分配,适用于简单脚本 CoroutineStackSize int `yaml:"coroutine_stack_size"` - // MinimizeStackMemory 启用栈内存自动收缩以减少内存占用 - MinimizeStackMemory bool `yaml:"minimize_stack_memory"` - // CoroutinePoolWarmup 协程池预热数量,启动时预创建 CoroutinePoolWarmup int `yaml:"coroutine_pool_warmup"` + + // EnableFileWatch 启用文件变更检测 + EnableFileWatch bool `yaml:"enable_file_watch"` + + // MinimizeStackMemory 启用栈内存自动收缩以减少内存占用 + MinimizeStackMemory bool `yaml:"minimize_stack_memory"` } // StreamConfig TCP/UDP Stream 代理配置。 diff --git a/internal/lua/config.go b/internal/lua/config.go index aab52ea..1944427 100644 --- a/internal/lua/config.go +++ b/internal/lua/config.go @@ -13,13 +13,13 @@ type Config struct { CodeCacheSize int CodeCacheTTL time.Duration MaxExecutionTime time.Duration - EnableFileWatch bool - EnableOSLib bool - EnableIOLib bool - EnableLoadLib bool - CoroutineStackSize int // 协程栈大小(默认64,最大256) + CoroutineStackSize int // 协程栈大小(默认64,最大256) + CoroutinePoolWarmup int // 协程池预热数量,启动时预创建 + EnableFileWatch bool // 1 + EnableOSLib bool // 1 + EnableIOLib bool // 1 + EnableLoadLib bool // 1 MinimizeStackMemory bool // 启用栈内存自动收缩以减少内存占用 - CoroutinePoolWarmup int // 协程池预热数量,启动时预创建 } // DefaultConfig 返回默认配置 diff --git a/internal/lua/middleware_config.go b/internal/lua/middleware_config.go index afb6d2c..5ad8013 100644 --- a/internal/lua/middleware_config.go +++ b/internal/lua/middleware_config.go @@ -40,9 +40,6 @@ type GlobalLuaSettings struct { // CodeCacheSize 字节码缓存条目数 CodeCacheSize int `yaml:"code_cache_size"` - // EnableFileWatch 启用文件变更检测 - EnableFileWatch bool `yaml:"enable_file_watch"` - // MaxExecutionTime 单脚本最大执行时间 MaxExecutionTime time.Duration `yaml:"max_execution_time"` @@ -50,11 +47,14 @@ type GlobalLuaSettings struct { // 较小的栈减少内存分配,适用于简单脚本 CoroutineStackSize int `yaml:"coroutine_stack_size"` - // MinimizeStackMemory 启用栈内存自动收缩以减少内存占用 - MinimizeStackMemory bool `yaml:"minimize_stack_memory"` - // CoroutinePoolWarmup 协程池预热数量,启动时预创建 CoroutinePoolWarmup int `yaml:"coroutine_pool_warmup"` + + // EnableFileWatch 启用文件变更检测 + EnableFileWatch bool `yaml:"enable_file_watch"` + + // MinimizeStackMemory 启用栈内存自动收缩以减少内存占用 + MinimizeStackMemory bool `yaml:"minimize_stack_memory"` } // DefaultMiddlewareConfig 默认 Lua 中间件配置