zhangmeng
2019-12-12 d6dc2a8f47c653c2cd002c35ed5b8360bdc7a863
update
2个文件已修改
14 ■■■■■ 已修改文件
proc/master.go 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proc/single.go 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proc/master.go
@@ -13,7 +13,7 @@
}
// MasterRole master
func MasterRole(ctx context.Context) {
func MasterRole(ctx context.Context) bool {
    reaper(ctx)
    util.InitDBAPI()
@@ -35,4 +35,5 @@
        }
        logo.Infof("START %d PROC %d SDK %s ID %s\n", k, pid, v.IpcId, v.SdkType)
    }
    return true
}
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) {