private bool TryLoadDocumentsFromFutureBatches(Etag nextDocEtag)
{
if (context.Configuration.DisableDocumentPreFetchingForIndexing)
return false;
try
{
FutureIndexBatch nextBatch;
if (futureIndexBatches.TryRemove(nextDocEtag, out nextBatch) == false)
return false;
if (Task.CurrentId == nextBatch.Task.Id)
return false;
foreach (var jsonDocument in nextBatch.Task.Result)
{
prefetchingQueue.Add(jsonDocument);
}
return true;
}
catch (Exception e)
{
log.WarnException("Error when getting next batch value asynchronously, will try in sync manner", e);
return false;
}
}