From 93ffb04780fd6ed8ef65c37b6a6ec23b88694e95 Mon Sep 17 00:00:00 2001 From: aaron <462826@qq.com> Date: Fri, 4 Mar 2022 19:08:36 +0800 Subject: [PATCH] kill ztf process --- client/forge.config.js | 2 +- client/src/service.js | 6 +++--- cmd/server/main.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/forge.config.js b/client/forge.config.js index b9da9c35..c510eadc 100644 --- a/client/forge.config.js +++ b/client/forge.config.js @@ -1,6 +1,6 @@ module.exports = { electronPackagerConfig: { - "name": "ztf2", + "name": "ztf", "icon": "./ui/favicon.ico" }, packagerConfig: { diff --git a/client/src/service.js b/client/src/service.js index 5bd22ee4..a606bb00 100644 --- a/client/src/service.js +++ b/client/src/service.js @@ -41,7 +41,7 @@ export function startZtfServer() { } return new Promise((resolve, reject) => { const cwd = process.env.SERVER_CWD_PATH || path.dirname(serverExePath); - logInfo(`>> Starting ZTF Server from exe path with command "${serverExePath} -P ${portServer}" in "${cwd}"...`); + logInfo(`>> Starting ZTF Server from exe path with command "${serverExePath} -p ${portServer}" in "${cwd}"...`); const cmd = spawn(serverExePath, ['-p', portServer, "-uuid", uuid], { cwd, shell: true, @@ -97,8 +97,8 @@ export function startZtfServer() { return new Promise((resolve, reject) => { const cwd = process.env.SERVER_CWD_PATH || path.resolve(app.getAppPath(), '../'); - logInfo(`>> Starting ZTF development server from source with command "go run cmd/server/main.go -P 8085" in "${cwd}"`); - const cmd = spawn('go', ['run', 'main.go', '-P', '8085'], { + logInfo(`>> Starting ZTF development server from source with command "go run cmd/server/main.go -p ${portServer}" in "${cwd}"`); + const cmd = spawn('go', ['run', 'main.go', '-p', portServer], { cwd, shell: true, }); diff --git a/cmd/server/main.go b/cmd/server/main.go index b5983a6b..2e87f962 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -22,8 +22,8 @@ var ( // @contact.url https://github.com/easysoft/zentaoatf/issues // @contact.email 462626@qq.com func main() { - port = *flag.Int("p", 0, "服务端口") - uuid = *flag.String("uuid", "", "区分服务进程的唯一ID") + flag.IntVar(&port, "p", 0, "服务端口") + flag.StringVar(&uuid, "uuid", "", "区分服务进程的唯一ID") flag.Parse() webServer := web.Init(port) -- GitLab