mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
refs #935, avoid timestamp "overflow"
This commit is contained in:
committed by
Mathew Sutcliffe
parent
be24d069fe
commit
1c2ca5fca1
@@ -353,9 +353,17 @@ namespace BlackCore
|
|||||||
const QDateTime cacheTs(this->getCacheTimestamp(entity));
|
const QDateTime cacheTs(this->getCacheTimestamp(entity));
|
||||||
if (!cacheTs.isValid()) { return true; } // we have no cache ts
|
if (!cacheTs.isValid()) { return true; } // we have no cache ts
|
||||||
|
|
||||||
const QDateTime hts(this->getLatestSharedFileHeaderTimestamp(entity));
|
const QDateTime headerTimestamp(this->getLatestSharedFileHeaderTimestamp(entity));
|
||||||
if (!hts.isValid()) { return false; }
|
if (!headerTimestamp.isValid()) { return false; }
|
||||||
return hts > cacheTs;
|
|
||||||
|
// we restrict by latest entity from info objects (if available)
|
||||||
|
// a header ts shall be never newer than the info object, if it is it is an issue with shared file sync
|
||||||
|
const QDateTime infoObjectTs = this->getLatestEntityTimestampFromInfoObjects(entity);
|
||||||
|
if (infoObjectTs.isValid() && infoObjectTs < headerTimestamp)
|
||||||
|
{
|
||||||
|
return infoObjectTs > cacheTs;
|
||||||
|
}
|
||||||
|
return headerTimestamp > cacheTs;
|
||||||
}
|
}
|
||||||
|
|
||||||
CEntityFlags::Entity CDatabaseReader::getEntitesWithNewerHeaderTimestamp(CEntityFlags::Entity entities) const
|
CEntityFlags::Entity CDatabaseReader::getEntitesWithNewerHeaderTimestamp(CEntityFlags::Entity entities) const
|
||||||
|
|||||||
Reference in New Issue
Block a user