From a8a526303a910433b0da2202f87abf640e367a4c Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期四, 12 十二月 2019 10:46:57 +0800 Subject: [PATCH] bug fixed --- main.go | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 1d8d5c1..752aef4 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ "golang.org/x/sys/unix" "analysis/gosdk" + "basic.com/valib/gogpu.git" // "net/http" // _ "net/http/pprof" @@ -143,18 +144,21 @@ logo.Infoln(os.Args) ctx, cancel := context.WithCancel(context.Background()) + ret := false if role == single { - proc.SingleRole(ctx, runType, id, gpu, shm) + ret = proc.SingleRole(ctx, runType, id, gpu, shm) } else if role == master { setParamters() - proc.MasterRole(ctx) + ret = proc.MasterRole(ctx) } else if role == slave { - proc.SingleRole(ctx, runType, id, gpu, shm) + ret = proc.SingleRole(ctx, runType, id, gpu, shm) } - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, os.Kill, unix.SIGTERM) - <-c + if ret { + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt, os.Kill, unix.SIGTERM) + <-c + } cancel() -- Gitblit v1.8.0