Commit 708193c5631338da52772f3c572a092813e23be4

Authored by 潘钊
1 parent f47e8872

update...

src/main/java/com/bsth/data/ThreadMonotor.java
1 1 package com.bsth.data;
2 2  
3 3 import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
  4 +import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
4 5 import com.bsth.data.msg_queue.DirectivePushQueue;
5 6 import com.bsth.data.msg_queue.WebSocketPushQueue;
6 7 import org.slf4j.Logger;
... ... @@ -24,6 +25,11 @@ public class ThreadMonotor extends Thread{
24 25 GpsRealAnalyse.shutdown();
25 26 }
26 27  
  28 + if(GpsRealAnalyse.isIdle()){
  29 + //尝试使用网关的GPS实时对照数据
  30 + GpsDataLoaderThread.setFlag(-1);
  31 + }
  32 +
27 33 //webSocket 消息推送队列
28 34 if(WebSocketPushQueue.isIdle()){
29 35 log.warn("WebSocketPushQueue isIdle true !!!!");
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
... ... @@ -50,6 +50,10 @@ public class GpsRealAnalyse {
50 50 return System.currentTimeMillis() - st > 1000 * 20;
51 51 }
52 52  
  53 + public static boolean isIdle(){
  54 + return System.currentTimeMillis() - st > 1000 * 30;
  55 + }
  56 +
53 57 public void analyse(List<GpsEntity> list) {
54 58 try {
55 59 st = System.currentTimeMillis();
... ...