Commit e21439d99a5c154731c64c5ae447ce8dec722158
1 parent
aba79129
update...
Showing
2 changed files
with
4 additions
and
2 deletions
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
| 1 | package com.bsth.data.safe_driv; | 1 | package com.bsth.data.safe_driv; |
| 2 | 2 | ||
| 3 | +import com.bsth.Application; | ||
| 3 | import com.bsth.websocket.handler.SendUtils; | 4 | import com.bsth.websocket.handler.SendUtils; |
| 4 | import org.joda.time.format.DateTimeFormat; | 5 | import org.joda.time.format.DateTimeFormat; |
| 5 | import org.joda.time.format.DateTimeFormatter; | 6 | import org.joda.time.format.DateTimeFormatter; |
| @@ -14,6 +15,7 @@ import java.util.HashMap; | @@ -14,6 +15,7 @@ import java.util.HashMap; | ||
| 14 | import java.util.HashSet; | 15 | import java.util.HashSet; |
| 15 | import java.util.Map; | 16 | import java.util.Map; |
| 16 | import java.util.Set; | 17 | import java.util.Set; |
| 18 | +import java.util.concurrent.TimeUnit; | ||
| 17 | 19 | ||
| 18 | /** | 20 | /** |
| 19 | * 安全驾驶 | 21 | * 安全驾驶 |
| @@ -67,7 +69,7 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | @@ -67,7 +69,7 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | ||
| 67 | @Override | 69 | @Override |
| 68 | public void run(String... strings) throws Exception { | 70 | public void run(String... strings) throws Exception { |
| 69 | //定时加载安全驾驶数据 | 71 | //定时加载安全驾驶数据 |
| 70 | - //Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 4, TimeUnit.SECONDS); | 72 | + Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 50, TimeUnit.SECONDS); |
| 71 | } | 73 | } |
| 72 | 74 | ||
| 73 | @Override | 75 | @Override |
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
| @@ -88,7 +88,7 @@ public class SafeDrivDataLoadThread extends Thread{ | @@ -88,7 +88,7 @@ public class SafeDrivDataLoadThread extends Thread{ | ||
| 88 | httpClient.close(); | 88 | httpClient.close(); |
| 89 | response.close(); | 89 | response.close(); |
| 90 | } catch (Exception e) { | 90 | } catch (Exception e) { |
| 91 | - logger.error(e.getMessage()); | 91 | + logger.error("安全驾驶接口报错了" , e.getMessage()); |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | } | 94 | } |