Tweak timings and use lock in backup to make it a bit faster and still permit main thread to work.

This commit is contained in:
Adam Ierymenko 2015-11-03 15:56:24 -08:00
parent 7903f24a8f
commit f7a407ffa0

View File

@ -1029,9 +1029,11 @@ void SqliteNetworkController::threadMain()
int rc = SQLITE_OK;
for(;;) {
rc = sqlite3_backup_step(bak,1);
_lock.lock();
rc = sqlite3_backup_step(bak,64);
_lock.unlock();
if ((rc == SQLITE_OK)||(rc == SQLITE_LOCKED)||(rc == SQLITE_BUSY))
Thread::sleep(100);
Thread::sleep(50);
else break;
}
@ -1041,8 +1043,7 @@ void SqliteNetworkController::threadMain()
OSUtils::rm(backupPath2);
::rename(backupPath,backupPath2);
}
Thread::sleep(500);
Thread::sleep(250);
}
}