Commit 36404ec9d7d701630cef2f8edd7c6e1df4f34236
1 parent
5d2e6039
update...
Showing
3 changed files
with
5 additions
and
3 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java
| ... | ... | @@ -30,7 +30,8 @@ public class OfflineSignalHandle extends SignalHandle{ |
| 30 | 30 | |
| 31 | 31 | if(isNotEmpty(prevs)){ |
| 32 | 32 | GpsEntity prev = prevs.getTail(); |
| 33 | - int space = (int) (gps.getTimestamp() - prev.getTimestamp()); | |
| 33 | + //间隔太大就丢弃,不管之前还是之后 | |
| 34 | + int space = Math.abs((int) (gps.getTimestamp() - prev.getTimestamp())); | |
| 34 | 35 | if(space > OFFLINE_TIME) |
| 35 | 36 | gps.setSignalState("reconnection"); |
| 36 | 37 | ... | ... |
src/main/java/com/bsth/util/db/DBUtils_oldSystem.java
| ... | ... | @@ -50,8 +50,8 @@ public class DBUtils_oldSystem { |
| 50 | 50 | pool_conf.put("testConnectionOnCheckout", false); |
| 51 | 51 | //异步检测连接的有效性 |
| 52 | 52 | pool_conf.put("testConnectionOnCheckin", true); |
| 53 | - //10分钟检测一次 | |
| 54 | - pool_conf.put("idleConnectionTestPeriod", 60 * 10); | |
| 53 | + //30秒检测一次 | |
| 54 | + pool_conf.put("idleConnectionTestPeriod", 30); | |
| 55 | 55 | ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); |
| 56 | 56 | } catch (ClassNotFoundException e) { |
| 57 | 57 | logger.error(e.toString()); | ... | ... |