* Reindex the repository only if there is at least one provider that required scanning and reindexing.
*/
protected void reindexIfNeeded() {
final ScanningRequest request = toBeScanned.drain();
if (!request.isEmpty()) {
final IndexWriter writer = indexManager.getIndexWriterForProviders(request.providerNames());
final RepositoryCache repoCache = runningState.repositoryCache();
scan(true, writer, new Callable<Void>() {
@Override
public Void call() throws Exception {
// Scan each of the workspace-path pairs ...