Skip to content

Commit 4c583b5

Browse files
committed
handle fallbehind
1 parent 74e2502 commit 4c583b5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/tracker.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,10 +2904,14 @@ function liveData() {
29042904

29052905
client.on('message', function (topic, message) {
29062906
var frame = JSON.parse(message.toString());
2907-
var test = formatData(frame, true);
2908-
update(test);
2909-
$("#stTimer").attr("data-timestamp", new Date().getTime());
2910-
$("#stText").text("websocket |");
2907+
if ((new Date().getTime() - new Date(frame.time_received).getTime()) < 30000) {
2908+
var test = formatData(frame, true);
2909+
update(test);
2910+
$("#stTimer").attr("data-timestamp", new Date().getTime());
2911+
$("#stText").text("websocket |");
2912+
} else {
2913+
$("#stText").text("error |");
2914+
}
29112915
})
29122916
}
29132917

0 commit comments

Comments
 (0)