WANG 5 роки тому
батько
коміт
2c0afa867a

+ 16 - 10
examcloud-core-oe-face-starter/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/starter/config/ProcessBaiduFaceLivenessAlarmTask.java

@@ -44,21 +44,27 @@ public class ProcessBaiduFaceLivenessAlarmTask implements ApplicationRunner {
 
 	@Override
 	public void run(ApplicationArguments args) throws Exception {
-		new Thread(() -> {
+		Thread thread = new Thread(new Runnable() {
 
-			Util.sleep(30);
+			@Override
+			public void run() {
+				Util.sleep(10);
 
-			while (true) {
-				try {
-					faceLivenessDectectAlarm();
-				} catch (Exception e) {
-					captureLog.error("[FACE_LIVENESS_ALARM.] 活体检测预警出现异常", e);
+				while (true) {
+					try {
+						faceLivenessDectectAlarm();
+					} catch (Exception e) {
+						captureLog.error("[FACE_LIVENESS_ALARM.] 活体检测预警出现异常", e);
+					}
+
+					// 每分钟轮循一次
+					Util.sleep(60);
 				}
 
-				// 每分钟轮循一次
-				Util.sleep(60);
 			}
-		}).start();
+		});
+		thread.setDaemon(true);
+		thread.start();
 	}
 
 	/**

+ 17 - 11
examcloud-core-oe-face-starter/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/starter/config/ProcessFaceCompareAlarmTask.java

@@ -45,21 +45,27 @@ public class ProcessFaceCompareAlarmTask implements ApplicationRunner {
 	@Override
 	public void run(ApplicationArguments args) throws Exception {
 
-		new Thread(() -> {
+		Thread thread = new Thread(new Runnable() {
 
-			Util.sleep(30);
-			
-			while (true) {
-				try {
-					faceCompareAlarm();
+			@Override
+			public void run() {
+				Util.sleep(10);
 
-				} catch (StatusException e) {
-					captureLog.error("[FACE_COMPARE_ALARM.] 人脸比对预警出现异常 ", e);
+				while (true) {
+					try {
+						faceCompareAlarm();
+
+					} catch (StatusException e) {
+						captureLog.error("[FACE_COMPARE_ALARM.] 人脸比对预警出现异常 ", e);
+					}
+					// 每分钟轮循一次
+					Util.sleep(60);
 				}
-				// 每分钟轮循一次
-				Util.sleep(60);
 			}
-		}).start();
+		});
+
+		thread.setDaemon(true);
+		thread.start();
 	}
 
 	/**