Commit 5cf2fc31 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

DiscovererWorker: Warn if no discoverer worker accepted an entrypoint

parent 883a53f1
...@@ -241,6 +241,7 @@ void DiscovererWorker::runUnban( const std::string& entryPoint ) ...@@ -241,6 +241,7 @@ void DiscovererWorker::runUnban( const std::string& entryPoint )
void DiscovererWorker::runDiscover( const std::string& entryPoint ) void DiscovererWorker::runDiscover( const std::string& entryPoint )
{ {
m_ml->getCb()->onDiscoveryStarted( entryPoint ); m_ml->getCb()->onDiscoveryStarted( entryPoint );
auto discovered = false;
for ( auto& d : m_discoverers ) for ( auto& d : m_discoverers )
{ {
// Assume only one discoverer can handle an entrypoint. // Assume only one discoverer can handle an entrypoint.
...@@ -252,6 +253,7 @@ void DiscovererWorker::runDiscover( const std::string& entryPoint ) ...@@ -252,6 +253,7 @@ void DiscovererWorker::runDiscover( const std::string& entryPoint )
auto duration = std::chrono::steady_clock::now() - chrono; auto duration = std::chrono::steady_clock::now() - chrono;
LOG_DEBUG( "Discovered ", entryPoint, " in ", LOG_DEBUG( "Discovered ", entryPoint, " in ",
std::chrono::duration_cast<std::chrono::microseconds>( duration ).count(), "µs" ); std::chrono::duration_cast<std::chrono::microseconds>( duration ).count(), "µs" );
discovered = true;
break; break;
} }
} }
...@@ -263,6 +265,8 @@ void DiscovererWorker::runDiscover( const std::string& entryPoint ) ...@@ -263,6 +265,8 @@ void DiscovererWorker::runDiscover( const std::string& entryPoint )
if ( m_run == false ) if ( m_run == false )
break; break;
} }
if ( discovered == false )
LOG_WARN( "No IDiscoverer found to discover ", entryPoint );
m_ml->getCb()->onDiscoveryCompleted( entryPoint ); m_ml->getCb()->onDiscoveryCompleted( entryPoint );
} }
......
Markdown is supported
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