File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ void unixDie(const std::string& str)
35
35
throw std::runtime_error (str+string (" : " )+string (strerror (errno)));
36
36
}
37
37
38
+ // station numbers
38
39
vector<uint64_t > getSources ()
39
40
{
40
41
DIR *dir = opendir (g_storage.c_str ());
98
99
while (getRawNMM (fd, ts, msg, offset)) {
99
100
// don't drop data that is only 5 seconds too old
100
101
if (make_pair (ts.tv_sec + 5 , ts.tv_nsec ) >= make_pair (start.tv_sec , start.tv_nsec )) {
102
+ if (ts.tv_sec > time (0 )) {
103
+ cout << " station " <<src <<" is living in the future, skipping message\n " ;
104
+ }
105
+ else
101
106
rnmms.push_back ({ts, msg});
102
107
}
103
108
++looked;
126
131
if (3600 + start.tv_sec - (start.tv_sec % 3600 ) < time (0 ))
127
132
start.tv_sec = 3600 + start.tv_sec - (start.tv_sec % 3600 );
128
133
else {
129
- if (!rnmms.empty ())
134
+ if (!rnmms.empty ()) // start off where we left it
130
135
start = {rnmms.rbegin ()->first .tv_sec , rnmms.rbegin ()->first .tv_nsec };
136
+ // This is a bit iffy as it relies on the station furthest ahead in time
131
137
sleep (1 );
132
138
}
133
139
}
You can’t perform that action at this time.
0 commit comments