feat(logic): 优化命令行参数解析和服务器初始化逻辑
- 将命令行参数解析移至 controller 包的 init 函数中 - 添加 PortBL 配置项判断,实现 login 服务器的条件初始化 - 移除 main 函数中的重复代码 - 在 login 服务器中启用 pprof 性能分析工具 - 删除未使用的 Start 函数和相关代码
This commit is contained in:
@@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
|
||||
"blazing/cool"
|
||||
|
||||
@@ -25,7 +26,9 @@ var (
|
||||
|
||||
s := g.Server()
|
||||
s.SetServerAgent(cool.Config.Name)
|
||||
|
||||
runtime.SetMutexProfileFraction(1) // (非必需)开启对锁调用的跟踪
|
||||
runtime.SetBlockProfileRate(1) // (非必需)开启对阻塞操作的跟踪
|
||||
s.EnablePProf()
|
||||
// 如果存在 data/cool-admin-vue/dist 目录,则设置为主目录
|
||||
if gfile.IsDir("public") {
|
||||
s.SetServerRoot("public")
|
||||
|
||||
Reference in New Issue
Block a user