Only warn about SQLite being busy once

No need to get annoying.
This commit is contained in:
Eelco Dolstra 2013-01-23 16:45:10 +01:00
parent 99ed558a93
commit 5e9c3da412

View file

@ -47,7 +47,11 @@ static void throwSQLiteError(sqlite3 * db, const format & f)
{ {
int err = sqlite3_errcode(db); int err = sqlite3_errcode(db);
if (err == SQLITE_BUSY) { if (err == SQLITE_BUSY) {
printMsg(lvlError, "warning: SQLite database is busy"); static bool warned = false;
if (!warned) {
printMsg(lvlError, "warning: SQLite database is busy");
warned = true;
}
/* Sleep for a while since retrying the transaction right away /* Sleep for a while since retrying the transaction right away
is likely to fail again. */ is likely to fail again. */
#if HAVE_NANOSLEEP #if HAVE_NANOSLEEP