diff --git a/.vscode/launch.json b/.vscode/launch.json index d8b223a7..87e66b85 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,25 +1,27 @@ -{ - // 使用 IntelliSense 了解相关属性。 - // 悬停以查看现有属性的描述。 - // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch login", - "type": "go", - "request": "launch", - "mode": "auto", - "cwd": "${workspaceFolder}", - "program": "${workspaceFolder}/login" - }, - { - "name": "Launch logic", - "type": "go", - "request": "launch", - "mode": "auto", - "cwd": "${workspaceFolder}", - "program": "${workspaceFolder}/logic" - } - - ] +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "name": "Launch login", + "type": "go", + "request": "launch", + "mode": "auto", + "cwd": "${workspaceFolder}", + "program": "${workspaceFolder}/login" + }, + { + "name": "Launch logic", + "type": "go", + "request": "launch", + "mode": "auto", + "cwd": "${workspaceFolder}", + "args": ["-port=30000"], + "program": "${workspaceFolder}/logic" + } + + ] } \ No newline at end of file diff --git a/common/cool/coolconfig/config.go b/common/cool/coolconfig/config.go index 0490c67d..abb71ea7 100644 --- a/common/cool/coolconfig/config.go +++ b/common/cool/coolconfig/config.go @@ -37,7 +37,7 @@ func newConfig() *sConfig { Name: GetCfgWithDefault(ctx, "server.name", g.NewVar("")).String(), Eps: GetCfgWithDefault(ctx, "blazing.eps", g.NewVar(false)).Bool(), Port: string(GetCfgWithDefault(ctx, "server.port", g.NewVar("8080")).String()), - PortBL: string(GetCfgWithDefault(ctx, "blazing.port", g.NewVar("8080")).String()), + //PortBL: string(GetCfgWithDefault(ctx, "blazing.port", g.NewVar("8080")).String()), File: &file{ Mode: GetCfgWithDefault(ctx, "blazing.file.mode", g.NewVar("none")).String(), Domain: GetCfgWithDefault(ctx, "blazing.file.domain", g.NewVar("http://127.0.0.1:8300")).String(), diff --git a/logic/1.exe b/logic/1.exe new file mode 100644 index 00000000..e50f7117 Binary files /dev/null and b/logic/1.exe differ diff --git a/logic/main.go b/logic/main.go index 9015286e..5531c82b 100644 --- a/logic/main.go +++ b/logic/main.go @@ -2,6 +2,7 @@ package main import ( _ "github.com/gogf/gf/contrib/nosql/redis/v2" + "github.com/gogf/gf/v2/os/gcmd" "blazing/common/socket" "blazing/common/socket/handler" @@ -12,6 +13,8 @@ import ( ) func main() { + // 解析命令行参数 + cool.Config.PortBL = gcmd.GetOpt("port", "27000").String() if cool.IsRedisMode { go cool.ListenFunc(gctx.New()) } diff --git a/manifest/config/config.yaml b/manifest/config/config.yaml index 42afa37c..f92faaf3 100644 --- a/manifest/config/config.yaml +++ b/manifest/config/config.yaml @@ -50,7 +50,6 @@ redis: pass: 154252 blazing: - port: 27000 ## 也是雪花算法生成端口 autoMigrate: true eps: true file: