added some debugging to see why the servers are spinning out constantly checking for dirty tree

This commit is contained in:
ZappoMan 2013-11-13 17:29:01 -08:00
parent 950f486e2e
commit 865d2d19f1

View file

@ -67,9 +67,13 @@ bool VoxelPersistThread::process() {
uint64_t MSECS_TO_USECS = 1000;
uint64_t USECS_TO_SLEEP = 100 * MSECS_TO_USECS; // every 100ms
usleep(USECS_TO_SLEEP);
uint64_t now = usecTimestampNow();
uint64_t sinceLastSave = now - _lastSave;
uint64_t intervalToCheck = _persistInterval * MSECS_TO_USECS;
if ((usecTimestampNow() - _lastSave) > (_persistInterval * MSECS_TO_USECS)) {
qDebug("checking if voxels are dirty.\n");
if (sinceLastSave > intervalToCheck) {
qDebug("checking if voxels are dirty. sinceLastSave=%llu intervalToCheck=%llu\n", sinceLastSave, intervalToCheck);
// check the dirty bit and persist here...
if (_tree->isDirty()) {
_lastSave = usecTimestampNow();