spell domainUnlimited right, and track challenges so that we don't reap

This commit is contained in:
Howard Stearns 2019-03-07 14:48:57 -08:00
parent 97bfa538ff
commit d309995aef

View file

@ -42,7 +42,7 @@
static const quint64 DELETED_ENTITIES_EXTRA_USECS_TO_CONSIDER = USECS_PER_MSEC * 50;
const float EntityTree::DEFAULT_MAX_TMP_ENTITY_LIFETIME = 60 * 60; // 1 hour
static const QString DOMAIN_UNLIMITED = "domainUnlimitied";
static const QString DOMAIN_UNLIMITED = "domainUnlimited";
EntityTree::EntityTree(bool shouldReaverage) :
Octree(shouldReaverage)
@ -293,7 +293,7 @@ void EntityTree::postAddEntity(EntityItemPointer entity) {
{
QWriteLocker locker(&_entityCertificateIDMapLock);
existingEntityItemID = _entityCertificateIDMap.value(certID);
if (!certID.isEmpty() && !entity->getCertificateType().contains(DOMAIN_UNLIMITED)) {
if (!certID.isEmpty()) {
_entityCertificateIDMap.insert(certID, entityItemID);
qCDebug(entities) << "Certificate ID" << certID << "belongs to" << entityItemID;
}
@ -301,7 +301,7 @@ void EntityTree::postAddEntity(EntityItemPointer entity) {
// Delete an already-existing entity from the tree if it has the same
// CertificateID as the entity we're trying to add.
if (!existingEntityItemID.isNull()) {
if (!existingEntityItemID.isNull() && !entity->getCertificateType().contains(DOMAIN_UNLIMITED)) {
qCDebug(entities) << "Certificate ID" << certID << "already exists on entity with ID"
<< existingEntityItemID << ". Deleting existing entity.";
deleteEntity(existingEntityItemID, true);