1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Keep retrying on commit transaction locks.

This commit is contained in:
Christian Muehlhaeuser 2012-06-07 14:35:49 +02:00
parent 8d125f128c
commit 171f0e314b

View File

@ -102,7 +102,7 @@ TomahawkSqlQuery::commitTransaction()
if ( isBusyError( lastError() ) )
retries = 0;
tDebug() << "INFO: Retrying failed commit:" << lastQuery() << lastError().text();
tDebug() << "INFO: Retrying failed commit:" << retries << lastQuery() << lastError().text();
TomahawkUtils::msleep( 10 );
}
@ -125,7 +125,7 @@ TomahawkSqlQuery::showError()
bool
TomahawkSqlQuery::isBusyError( const QSqlError& error ) const
{
const QString text = error.text().toLower();
const QString text = error.text().trimmed().toLower();
return ( text.contains( "locked" ) || text.contains( "busy" ) );
return ( text.contains( "locked" ) || text.contains( "busy" ) || text.isEmpty() );
}