Merge pull request #12800 from huffman/fix/entity-lock

Remove lock file recovery in entity server
This commit is contained in:
John Conklin II 2018-04-06 10:04:34 -07:00 committed by GitHub
commit c8d109854b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,17 +192,12 @@ bool OctreePersistThread::process() {
QString lockFileName = _filename + ".lock";
std::ifstream lockFile(qPrintable(lockFileName), std::ios::in | std::ios::binary | std::ios::ate);
if (lockFile.is_open()) {
qCDebug(octree) << "WARNING: Octree lock file detected at startup:" << lockFileName
<< "-- Attempting to restore from previous backup file.";
// This is where we should attempt to find the most recent backup and restore from
// that file as our persist file.
restoreFromMostRecentBackup();
qCDebug(octree) << "WARNING: Octree lock file detected at startup:" << lockFileName;
lockFile.close();
qCDebug(octree) << "Loading Octree... lock file closed:" << lockFileName;
qCDebug(octree) << "Removing lock file:" << lockFileName;
remove(qPrintable(lockFileName));
qCDebug(octree) << "Loading Octree... lock file removed:" << lockFileName;
qCDebug(octree) << "Lock file removed:" << lockFileName;
}
persistentFileRead = _tree->readFromFile(qPrintable(_filename.toLocal8Bit()));