Commit dc8fbae9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

SqliteTools: Don't retry forever when the db is busy

parent 2d69edad
......@@ -146,6 +146,7 @@ public:
Row row()
{
auto maxRetries = 10;
while ( true )
{
auto res = sqlite3_step( m_stmt.get() );
......@@ -154,7 +155,7 @@ public:
else if ( res == SQLITE_DONE )
return Row();
else if ( res == SQLITE_BUSY && ( Transaction::transactionInProgress() == false ||
m_isCommit == true ) )
m_isCommit == true ) && maxRetries-- > 0 )
continue;
std::string errMsg = sqlite3_errmsg( m_dbConn );
switch ( res )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment