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

* Fixed TWK-435: Don't block pipeline if a resolver times out.

This commit is contained in:
Christian Muehlhaeuser 2011-08-21 03:31:29 +02:00
parent 977757cc7e
commit 1653e16e7d

View File

@ -196,22 +196,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
}
}
if ( decQIDState( q ) == 0 )
{
if ( !q->solved() || q->isFullTextQuery() )
q->onResolvingFinished();
if ( !m_queries_temporary.contains( q ) )
m_qids.remove( q->id() );
if ( m_qidsTimeout.contains( q->id() ) )
m_qidsTimeout.remove( q->id() );
shuntNext();
}
else
{
new FuncTimeout( 0, boost::bind( &Pipeline::timeoutShunt, this, q ), this );
}
decQIDState( q );
}
@ -260,8 +245,7 @@ Pipeline::timeoutShunt( const query_ptr& q )
// are we still waiting for a timeout?
if ( m_qidsTimeout.contains( q->id() ) )
{
m_qidsTimeout.remove( q->id() );
shunt( q );
decQIDState( q );
}
}
@ -278,7 +262,7 @@ Pipeline::shunt( const query_ptr& q )
if ( r )
{
qDebug() << "Dispatching to resolver" << r->name() << q->toString() << q->solved() << q->id();
tDebug() << "Dispatching to resolver" << r->name() << q->toString() << q->solved() << q->id();
q->setCurrentResolver( r );
r->resolve( q );
@ -374,6 +358,25 @@ Pipeline::decQIDState( const Tomahawk::query_ptr& query )
// qDebug() << "Queries running:" << m_qidsState.count();
}
if ( state == 0 )
{
if ( !query->solved() || query->isFullTextQuery() )
query->onResolvingFinished();
if ( !m_queries_temporary.contains( query ) )
m_qids.remove( query->id() );
if ( m_qidsTimeout.contains( query->id() ) )
m_qidsTimeout.remove( query->id() );
new FuncTimeout( 0, boost::bind( &Pipeline::shuntNext, this ), this );
}
else
{
if ( m_qidsTimeout.contains( query->id() ) )
m_qidsTimeout.remove( query->id() );
new FuncTimeout( 0, boost::bind( &Pipeline::shunt, this, query ), this );
}
return state;
}