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)
3535 throw std::runtime_error (str+string (" : " )+string (strerror (errno)));
3636}
3737
38+ // station numbers
3839vector<uint64_t > getSources ()
3940{
4041 DIR *dir = opendir (g_storage.c_str ());
9899 while (getRawNMM (fd, ts, msg, offset)) {
99100 // don't drop data that is only 5 seconds too old
100101 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
101106 rnmms.push_back ({ts, msg});
102107 }
103108 ++looked;
126131 if (3600 + start.tv_sec - (start.tv_sec % 3600 ) < time (0 ))
127132 start.tv_sec = 3600 + start.tv_sec - (start.tv_sec % 3600 );
128133 else {
129- if (!rnmms.empty ())
134+ if (!rnmms.empty ()) // start off where we left it
130135 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
131137 sleep (1 );
132138 }
133139 }
You can’t perform that action at this time.
0 commit comments