From 5018fec1d3ea2461c80615a98e9b8e43b47f9425 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 13 一月 2020 10:51:38 +0800 Subject: [PATCH] debug --- run.go | 25 ++++++------------------- 1 files changed, 6 insertions(+), 19 deletions(-) diff --git a/run.go b/run.go index df0ef59..956247b 100644 --- a/run.go +++ b/run.go @@ -69,7 +69,6 @@ return case id := <-ch: f.mapChanLock.Lock() - defer f.mapChanLock.Unlock() for k, v := range f.mapChan { v.life-- if k == id { @@ -81,6 +80,8 @@ delete(f.mapChan, k) } } + f.mapChanLock.Unlock() + default: time.Sleep(10 * time.Millisecond) } @@ -216,9 +217,7 @@ wg := &sync.WaitGroup{} for _, msg := range msgs { - f.fnLogger("######Maintain :", msg.Cid) f.chLife <- msg.Cid - f.fnLogger("######Maintain Over :", msg.Cid) if c, ok := f.channelExist(msg.Cid); ok { wg.Add(1) @@ -232,15 +231,6 @@ continue } - i := sdkhelper.UnpackImage(msg, f.typ, f.fnLogger) - if i == nil { - sdkhelper.EjectResult(nil, msg, out) - continue - } - // conv to bgr24 and resize - imgW, imgH := int(i.Width), int(i.Height) - ret := f.handle.TrackerResize(imgW, imgH, nc.index) - f.fnLogger("ResizeFaceTracker: cid: ", msg.Cid, " chan: ", nc.index, " wXh: ", imgW, "x", imgH, " result:", ret) wg.Add(1) go f.track(wg, &msg, nc.index, out) } @@ -254,8 +244,6 @@ defer wg.Done() rMsg := *msg - - f.fnLogger("######Recv From: ", rMsg.Cid, " Chan: ", tchan) if !sdkhelper.ValidRemoteMessage(rMsg, f.typ, f.fnLogger) { sdkhelper.EjectResult(nil, rMsg, out) @@ -275,13 +263,12 @@ // conv to bgr24 and resize imgW, imgH := int(i.Width), int(i.Height) - f.fnLogger("######Run cid:", rMsg.Cid, "chan: ", tchan) - count, data, _ := f.handle.Run(i.Data, imgW, imgH, 3, tchan) - f.fnLogger("######Over run cid:", rMsg.Cid, "chan: ", tchan) + ret := f.handle.TrackerResize(imgW, imgH, tchan) + f.fnLogger("ResizeFaceTracker: cid: ", msg.Cid, " chan: ", tchan, " wXh: ", imgW, "x", imgH, " result:", ret) - f.fnLogger("######Eject cid:", rMsg.Cid, "chan: ", tchan) + count, data, _ := f.handle.Run(i.Data, imgW, imgH, 3, tchan) + sdkhelper.EjectResult(data, rMsg, out) - f.fnLogger("######Over eject cid:", rMsg.Cid, "chan: ", tchan) var id, name string if rMsg.Tasklab != nil { -- Gitblit v1.8.0