if given timestamp is in the future, reset it, it is likely invalid
This commit is contained in:
parent
ba2c111762
commit
c9bc5a8cd8
|
@ -60,10 +60,16 @@ Event::Event(
|
||||||
std::string notes;
|
std::string notes;
|
||||||
createNotes(notes);
|
createNotes(notes);
|
||||||
|
|
||||||
|
struct timeval now;
|
||||||
|
gettimeofday(&now, 0);
|
||||||
|
|
||||||
bool untimedEvent = false;
|
bool untimedEvent = false;
|
||||||
if ( !start_time.tv_sec ) {
|
if ( !start_time.tv_sec ) {
|
||||||
untimedEvent = true;
|
untimedEvent = true;
|
||||||
gettimeofday(&start_time, 0);
|
start_time = now;
|
||||||
|
} else if ( start_time.tv_sec > now.tv_sec ) {
|
||||||
|
Error("StartTime in the future");
|
||||||
|
start_time = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage * storage = monitor->getStorage();
|
Storage * storage = monitor->getStorage();
|
||||||
|
|
Loading…
Reference in New Issue