1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02: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() ) ) if ( isBusyError( lastError() ) )
retries = 0; retries = 0;
tDebug() << "INFO: Retrying failed commit:" << lastQuery() << lastError().text(); tDebug() << "INFO: Retrying failed commit:" << retries << lastQuery() << lastError().text();
TomahawkUtils::msleep( 10 ); TomahawkUtils::msleep( 10 );
} }
@@ -125,7 +125,7 @@ TomahawkSqlQuery::showError()
bool bool
TomahawkSqlQuery::isBusyError( const QSqlError& error ) const 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() );
} }