Query only one event at the beginning (to find the ID of the latest event)
Syncthing's official web UI also does the first query for events like this. This should make loading times a bit faster and removes the possibility of picking-up obsolete events (which was always problematic).
This commit is contained in:
parent
6cfa8a96b6
commit
fdc73bed60
|
@ -1507,6 +1507,8 @@ void SyncthingConnection::requestEvents()
|
|||
QUrlQuery query;
|
||||
if (m_lastEventId) {
|
||||
query.addQueryItem(QStringLiteral("since"), QString::number(m_lastEventId));
|
||||
} else {
|
||||
query.addQueryItem(QStringLiteral("limit"), QStringLiteral("1"));
|
||||
}
|
||||
// force to return immediately after the first call
|
||||
if (!m_hasEvents) {
|
||||
|
|
Loading…
Reference in New Issue