|
@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.core.oe.student.face.service.impl;
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.ThreadLocalUtil;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
|
|
@@ -13,6 +14,7 @@ import cn.com.qmth.examcloud.core.oe.common.base.Constants;
|
|
import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
|
|
import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
|
|
import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
|
|
import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
|
|
import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
|
+import org.apache.logging.log4j.ThreadContext;
|
|
|
|
|
|
/**
|
|
/**
|
|
* face++人脸比对工作线程
|
|
* face++人脸比对工作线程
|
|
@@ -24,6 +26,9 @@ public class FacePPCompareWorker implements Worker<ExamCaptureQueueEntity> {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void process(WorkerController controller, ExamCaptureQueueEntity element) {
|
|
public void process(WorkerController controller, ExamCaptureQueueEntity element) {
|
|
|
|
+
|
|
|
|
+ ThreadContext.put("TRACE_ID", "Q_" + element.getId());
|
|
|
|
+ ThreadContext.put("CALLER", "FACEPP_WORKER");
|
|
// 图片处理数量+1
|
|
// 图片处理数量+1
|
|
ExamCaptureProcessStatisticController.increaseFaceCompareCount();
|
|
ExamCaptureProcessStatisticController.increaseFaceCompareCount();
|
|
if (captureLog.isDebugEnabled()) {
|
|
if (captureLog.isDebugEnabled()) {
|
|
@@ -56,6 +61,8 @@ public class FacePPCompareWorker implements Worker<ExamCaptureQueueEntity> {
|
|
captureLog.error("[FACEPP_COMPARE_WORKER.] 系统异常 " + e.getMessage() +
|
|
captureLog.error("[FACEPP_COMPARE_WORKER.] 系统异常 " + e.getMessage() +
|
|
",failedCount=" + ExamCaptureProcessStatisticController.getFaceCompareFailedCount(), e);
|
|
",failedCount=" + ExamCaptureProcessStatisticController.getFaceCompareFailedCount(), e);
|
|
Util.sleep(TimeUnit.MICROSECONDS, 50);
|
|
Util.sleep(TimeUnit.MICROSECONDS, 50);
|
|
|
|
+ } finally {
|
|
|
|
+ ThreadContext.clearAll();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|