mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-22 18:01:09 +02:00
do not unzip or parse entities-backup on message thread
This commit is contained in:
parent
b7873a6194
commit
5ff0c5800e
1 changed files with 5 additions and 1 deletions
|
@ -1746,8 +1746,8 @@ void DomainServer::nodePingMonitor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::processOctreeDataPersistMessage(QSharedPointer<ReceivedMessage> message) {
|
void DomainServer::processOctreeDataPersistMessage(QSharedPointer<ReceivedMessage> message) {
|
||||||
qDebug() << "Received octree data persist message";
|
|
||||||
auto data = message->readAll();
|
auto data = message->readAll();
|
||||||
|
qDebug() << "Received octree data persist message" << (data.size() / 1000) << "kbytes.";
|
||||||
auto filePath = getEntitiesFilePath();
|
auto filePath = getEntitiesFilePath();
|
||||||
|
|
||||||
QDir dir(getEntitiesDirPath());
|
QDir dir(getEntitiesDirPath());
|
||||||
|
@ -1759,12 +1759,16 @@ void DomainServer::processOctreeDataPersistMessage(QSharedPointer<ReceivedMessag
|
||||||
QFile f(filePath);
|
QFile f(filePath);
|
||||||
if (f.open(QIODevice::WriteOnly)) {
|
if (f.open(QIODevice::WriteOnly)) {
|
||||||
f.write(data);
|
f.write(data);
|
||||||
|
#ifdef EXPENSIVE_NETWORK_DIAGNOSTICS
|
||||||
|
// These diagnostics take take more than 200ms (depending on content size),
|
||||||
|
// causing Socket::readPendingDatagrams to overrun its timebox.
|
||||||
OctreeUtils::RawEntityData entityData;
|
OctreeUtils::RawEntityData entityData;
|
||||||
if (entityData.readOctreeDataInfoFromData(data)) {
|
if (entityData.readOctreeDataInfoFromData(data)) {
|
||||||
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.dataVersion;
|
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.dataVersion;
|
||||||
} else {
|
} else {
|
||||||
qCDebug(domain_server) << "Failed to read new octree data info";
|
qCDebug(domain_server) << "Failed to read new octree data info";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
qCDebug(domain_server) << "Failed to write new entities file:" << filePath;
|
qCDebug(domain_server) << "Failed to write new entities file:" << filePath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue