zhangmeng
2019-12-12 d6dc2a8f47c653c2cd002c35ed5b8360bdc7a863
proc/single.go
@@ -8,19 +8,20 @@
)
// SingleRole 单进程
func SingleRole(ctx context.Context, typ string, ipcID string, gpu int, shm bool) {
func SingleRole(ctx context.Context, typ string, ipcID string, gpu int, shm bool) bool {
   util.InitDBAPI()
   ret := false
   if typ == util.FeatAll { // run all proc per proc
      allProc(ctx, gpu, shm)
      ret = allProc(ctx, gpu, shm)
   } else if typ == util.FeatFace || typ == util.FeatYolo { // run all face sdk
      sdkProc(ctx, typ, gpu, shm)
      ret = sdkProc(ctx, typ, gpu, shm)
   } else { // run one sdk per proc, typ is facedetect/yolodetect/facecompare etc. id is ipc
      slaveProc(ctx, typ, ipcID, gpu, shm)
      ret = slaveProc(ctx, typ, ipcID, gpu, shm)
   }
   return ret
}
func sdkProc(ctx context.Context, typ string, gpu int, shm bool) {