NavCache: tolerate missing branch nodes
Since we don't insert nodes in read-only mode, we need to tolerate their absence when loading.
This commit is contained in:
parent
78a89b3507
commit
5273c03c6c
1 changed files with 10 additions and 3 deletions
|
@ -1781,7 +1781,7 @@ void NavDataCache::commitTransaction()
|
|||
break;
|
||||
}
|
||||
|
||||
SGTimeStamp::sleepForMSec(++retries * 10);
|
||||
SGTimeStamp::sleepForMSec(++retries * 100);
|
||||
SG_LOG(SG_NAVCACHE, SG_ALERT, "NavCache contention on commit, will retry:" << retries);
|
||||
} // of retry loop for DB busy
|
||||
|
||||
|
@ -2106,8 +2106,15 @@ FGPositionedRef NavDataCache::findClosestWithIdent( const string& aIdent,
|
|||
|
||||
int NavDataCache::getOctreeBranchChildren(int64_t octreeNodeId)
|
||||
{
|
||||
sqlite3_bind_int64(d->getOctreeChildren, 1, octreeNodeId);
|
||||
d->execSelect1(d->getOctreeChildren);
|
||||
sqlite3_bind_int64(d->getOctreeChildren, 1, octreeNodeId);
|
||||
if (!d->execSelect(d->getOctreeChildren)) {
|
||||
// this can occur when in read-only mode: we don't add
|
||||
// new Octree nodes to the real DB (only in memory),
|
||||
// but will still call this code speculatively.
|
||||
// see the early-return just below in defineOctreeNode
|
||||
return 0;
|
||||
}
|
||||
|
||||
int children = sqlite3_column_int(d->getOctreeChildren, 0);
|
||||
d->reset(d->getOctreeChildren);
|
||||
return children;
|
||||
|
|
Loading…
Add table
Reference in a new issue