Skip to content

Commit 9ee29f3

Browse files
committed
inferserver| ipc part fix
1 parent bffe02a commit 9ee29f3

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

cmd/cortex/config.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,8 @@ func makeFullNode(ctx *cli.Context) *node.Node {
168168
log.Info("makeFullNode", "storageEnabled", storageEnabled)
169169
utils.RegisterStorageService(stack, &cfg.TorrentFs, gitCommit)
170170
}
171-
var wg sync.WaitGroup
172171
if deviceType := utils.IsCVMIPC(ctx.GlobalString(utils.InferDeviceTypeFlag.Name)); deviceType != "" {
173-
wg.Add(1)
174172
go func() {
175-
defer wg.Done()
176173
cmd := os.Args[0]
177174
log.Info("RegisterCVMService", "cmd", cmd)
178175
args := []string{"cvm",
@@ -198,30 +195,29 @@ func makeFullNode(ctx *cli.Context) *node.Node {
198195
if err := prg.Start(); err != nil {
199196
panic(err)
200197
}
198+
log.Info("Cvm service register success", "config", cfg)
201199
run_result := prg.Start()
202200
var wg sync.WaitGroup
203-
wg.Add(2)
201+
wg.Add(1)
204202
go func() {
205203
defer wg.Done()
206204
_, _ = io.Copy(stdout, stdoutIn)
207205
}()
206+
wg.Add(1)
208207
go func() {
209208
defer wg.Done()
210209
_, _ = io.Copy(stderr, stderrIn)
211210
}()
212-
//wg.Wait()
213-
211+
wg.Wait()
214212
if err := prg.Wait(); err != nil {
215213
log.Error("RegisterCVMService", "err", err)
216214
}
217215
log.Debug("RegisterCVMService", "deviceType", deviceType, "Exited", run_result)
218216
// outStr, errStr := string(stdoutBuf.Bytes()), string(stderrBuf.Bytes())
219217
// log.Debug("RegisterCVMService", "out", outStr, "err", errStr)
220218
}()
221-
wg.Wait()
222-
//time.Sleep(10000 * time.Millisecond)
223219
}
224-
wg.Wait()
220+
225221
utils.RegisterCortexService(stack, &cfg.Cortex)
226222

227223
// if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {

0 commit comments

Comments
 (0)