|
@@ -179,39 +179,39 @@ public class DaemonThread extends Thread {
|
|
|
}
|
|
|
LogOfRun.endTime = new Date();
|
|
|
|
|
|
- try {
|
|
|
- if (Constant.iot_websocket_url != null) {
|
|
|
- log.warn("iot-websocket");
|
|
|
- IOTWebSocketClient.client = new IOTWebSocketClient(new URI(Constant.iot_websocket_url + "?projectId="
|
|
|
- + RepositoryContainer.RepositoryProject.projectId.substring(2) + "&type=iot,text,pointset"));
|
|
|
- IOTWebSocketClient.client.connect();
|
|
|
- // while (!myClient.getReadyState().equals(READYSTATE.OPEN)) {
|
|
|
- // Thread.sleep(1000L);
|
|
|
- // log.info("连接中···请稍后");
|
|
|
- // }
|
|
|
- // log.info("连接成功");
|
|
|
- Thread.sleep(1000L);
|
|
|
- }
|
|
|
- if (Constant.alarm_enable) {
|
|
|
- log.warn("alarm-websocket");
|
|
|
- AlarmWebSocketClient.client = new AlarmWebSocketClient(
|
|
|
- new URI(Constant.alarm_websocket_url + "/" + RepositoryContainer.RepositoryProject.projectId));
|
|
|
- AlarmWebSocketClient.client.connect();
|
|
|
- // while (!myClient.getReadyState().equals(READYSTATE.OPEN)) {
|
|
|
- // Thread.sleep(1000L);
|
|
|
- // log.info("连接中···请稍后");
|
|
|
- // }
|
|
|
- // log.info("连接成功");
|
|
|
- Thread.sleep(1000L);
|
|
|
+ if (RepositoryContainer.RepositoryProject.compute_finish) {
|
|
|
+ try {
|
|
|
+ if (Constant.iot_websocket_url != null) {
|
|
|
+ log.warn("iot-websocket");
|
|
|
+ IOTWebSocketClient.client = new IOTWebSocketClient(new URI(Constant.iot_websocket_url + "?projectId="
|
|
|
+ + RepositoryContainer.RepositoryProject.projectId.substring(2) + "&type=iot,text,pointset"));
|
|
|
+ IOTWebSocketClient.client.connect();
|
|
|
+ // while (!myClient.getReadyState().equals(READYSTATE.OPEN)) {
|
|
|
+ // Thread.sleep(1000L);
|
|
|
+ // log.info("连接中···请稍后");
|
|
|
+ // }
|
|
|
+ // log.info("连接成功");
|
|
|
+ Thread.sleep(1000L);
|
|
|
+ }
|
|
|
+ if (Constant.alarm_enable) {
|
|
|
+ log.warn("alarm-websocket");
|
|
|
+ AlarmWebSocketClient.client = new AlarmWebSocketClient(
|
|
|
+ new URI(Constant.alarm_websocket_url + "/" + RepositoryContainer.RepositoryProject.projectId));
|
|
|
+ AlarmWebSocketClient.client.connect();
|
|
|
+ // while (!myClient.getReadyState().equals(READYSTATE.OPEN)) {
|
|
|
+ // Thread.sleep(1000L);
|
|
|
+ // log.info("连接中···请稍后");
|
|
|
+ // }
|
|
|
+ // log.info("连接成功");
|
|
|
+ Thread.sleep(1000L);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ String message = LogUtil.GetExceptionStackTrace(e);
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ LogOfRun.error(null, message);
|
|
|
+ LogOfRun.status = "failure";
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- String message = LogUtil.GetExceptionStackTrace(e);
|
|
|
- log.error(e.getMessage(), e);
|
|
|
- LogOfRun.error(null, message);
|
|
|
- LogOfRun.status = "failure";
|
|
|
- }
|
|
|
|
|
|
- if (RepositoryContainer.RepositoryProject.compute_finish) {
|
|
|
break;
|
|
|
}
|
|
|
}
|