Merge pull request #4158 from osmandapp/live_monitoring_fixes
Live monitoring fixes
This commit is contained in:
commit
a7c27eeb23
1 changed files with 4 additions and 1 deletions
|
@ -118,9 +118,11 @@ public class LiveMonitoringHelper {
|
||||||
while (isLiveMonitoringEnabled()) {
|
while (isLiveMonitoringEnabled()) {
|
||||||
for (ConcurrentLinkedQueue queue : concurrentLinkedQueues) {
|
for (ConcurrentLinkedQueue queue : concurrentLinkedQueues) {
|
||||||
if (!queue.isEmpty()) {
|
if (!queue.isEmpty()) {
|
||||||
LiveMonitoringData data = (LiveMonitoringData) queue.poll();
|
LiveMonitoringData data = (LiveMonitoringData) queue.peek();
|
||||||
if (!(System.currentTimeMillis() - data.time > settings.LIVE_MONITORING_MAX_INTERVAL_TO_SEND.get())) {
|
if (!(System.currentTimeMillis() - data.time > settings.LIVE_MONITORING_MAX_INTERVAL_TO_SEND.get())) {
|
||||||
sendData(data);
|
sendData(data);
|
||||||
|
} else {
|
||||||
|
queue.poll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,6 +199,7 @@ public class LiveMonitoringHelper {
|
||||||
urlConnection.getResponseMessage();
|
urlConnection.getResponseMessage();
|
||||||
log.error("Error sending monitor request: " + msg);
|
log.error("Error sending monitor request: " + msg);
|
||||||
} else {
|
} else {
|
||||||
|
queue.poll();
|
||||||
InputStream is = urlConnection.getInputStream();
|
InputStream is = urlConnection.getInputStream();
|
||||||
StringBuilder responseBody = new StringBuilder();
|
StringBuilder responseBody = new StringBuilder();
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
|
|
Loading…
Reference in a new issue