Browse Source

品牌抽取读取配置时容错处理

unknown 6 năm trước cách đây
mục cha
commit
85b81a6218
2 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 6 2
      src/jy/extract/extract.go
  2. 5 0
      src/jy/extract/extractudp.go

+ 6 - 2
src/jy/extract/extract.go

@@ -56,7 +56,9 @@ func StartExtractTestTask(taskId, startId, num, resultcoll, trackcoll string) bo
 	ext.InitAuditRecogField()
 
 	//品牌抽取是否开启
-	ju.IsBrandGoods = ju.Config["brandgoods"].(bool)
+	if ju.Config["brandgoods"] != nil {
+		ju.IsBrandGoods = ju.Config["brandgoods"].(bool)
+	}
 	return RunExtractTestTask(ext, startId, num)
 }
 
@@ -120,7 +122,9 @@ func StartExtractTaskId(taskId string) bool {
 	ext.InitAuditRecogField()
 
 	//品牌抽取是否开启
-	ju.IsBrandGoods = ju.Config["brandgoods"].(bool)
+	if ju.Config["brandgoods"] != nil {
+		ju.IsBrandGoods = ju.Config["brandgoods"].(bool)
+	}
 
 	ext.IsRun = true
 	go ext.ResultSave()

+ 5 - 0
src/jy/extract/extractudp.go

@@ -104,6 +104,11 @@ func ExtractByUdp(sid, eid string, instanceId ...string) {
 	ext.InitAuditClass()
 	ext.InitAuditRecogField()
 
+	//品牌抽取是否开启
+	if ju.Config["brandgoods"] != nil {
+		ju.IsBrandGoods = ju.Config["brandgoods"].(bool)
+	}
+
 	go ext.ResultSave()
 	go ext.BidSave()
 	ext.IsRun = true