diff options
| author | lonkaars <loek@pipeframe.xyz> | 2022-10-30 19:50:16 +0100 |
|---|---|---|
| committer | lonkaars <loek@pipeframe.xyz> | 2022-10-30 19:50:16 +0100 |
| commit | 64453a2c5d073b3cfb88cf43493d396881d7e058 (patch) | |
| tree | 77ce8fd61a823a2b7cd194dff27fd4ddd858aab5 /client/Client.cpp | |
| parent | 677192d416caeffe5be5aeff0f551b9679797132 (diff) | |
| parent | b82a9c44d0112f5433c4482e2e5802969515ce7d (diff) | |
Merge branch 'qt-settings' of https://github.com/UnavailableDev/avans-whether-station-Qt into dev
Diffstat (limited to 'client/Client.cpp')
| -rw-r--r-- | client/Client.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/Client.cpp b/client/Client.cpp index 61e51e4..2075fc2 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -54,9 +54,11 @@ void Client::timeFunction() { socket->write(msgToSend); } -void Client::missingRecords() { - QSqlQuery queryTimeData; - queryTimeData.exec("select unix_timestamp(now()) - unix_timestamp(time) as delta from WSdb.tblMain order by time desc limit 1"); +void Client::missingRecords() +{ + QSqlQuery queryTimeData; + queryTimeData.exec("SELECT (unix_timestamp(now()) - unix_timestamp(`time`))/60 as delta FROM `tblMain` limit 1"); + queryTimeData.first(); unsigned int secondsSinceLastRecord = queryTimeData.value(0).toInt(); _missingRecords = secondsSinceLastRecord / WS_CLIENT_STATION_POLL_INTERVAL; |