mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Keep retrying on commit transaction locks.
This commit is contained in:
@@ -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() );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user