From 77a05fa27d55ea7e39aee47f71cb5f74308e5e0e Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期五, 30 八月 2019 11:08:06 +0800 Subject: [PATCH] stop bigcache init --- algorithm/middleware/middleware.go | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/algorithm/middleware/middleware.go b/algorithm/middleware/middleware.go index a4577fa..5316a62 100644 --- a/algorithm/middleware/middleware.go +++ b/algorithm/middleware/middleware.go @@ -12,7 +12,7 @@ "time" ) -func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule) { +func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule) ([]*structure.LittleRuleResult,string,string){ resultSplice := []*structure.LittleRuleResult{} sdkNames := "" polygonId := "" @@ -150,6 +150,7 @@ } } } + return resultSplice,sdkNames,polygonId } func timeRuleResult(rule *protomsg.Rule, am *structure.AreaMap) structure.LittleRuleResult { @@ -211,16 +212,21 @@ func CallSo(sdkId string,rule *protomsg.Rule, am *structure.AreaMap) structure.LittleRuleResult{ // 鏍规嵁sdkId鏌ュ嚭鍏跺搴旂殑sdk鐨剆oName锛岃皟鐢ㄧ浉搴攕o鐨凟ntrance鏂规硶 - var soName = "" - if sdkId == "812b674b-2375-4589-919a-5c1c3278a97e" { - soName = "face.so" - } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a975"{ - soName = "intrusion.so" - } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a976" { - soName = "personUnsual.so" - } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a972" { - soName = "faceCompare.so" + //var soName = "" + //if sdkId == "812b674b-2375-4589-919a-5c1c3278a97e" { + // soName = "face.so" + //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a975"{ + // soName = "intrusion.so" + //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a976" { + // soName = "personUnsual.so" + //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a972" { + // soName = "faceCompare.so" + //} + soInfo,errr := cache.GetSoInfoById(sdkId) + if errr != nil { + panic("娌¤鍒版敞鍐岃〃") } + soName := soInfo.SoName p,err := plugin.Open("./algorithm/"+soName) if err != nil { panic(err) -- Gitblit v1.8.0