Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Docfx.Build.Engine/XRefMaps/XRefCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ public async Task<IXRefContainerReader> CreateAsync()
{
AddToDownloadList(_uris);
var dict = new Dictionary<string, IXRefContainer>();
foreach (var item in _processing)
while (_processing.Any())
{
var task = item.Key;
var uri = item.Value;
Task<IXRefContainer> task = await Task.WhenAny(_processing.Keys);
Uri uri = _processing[task];
_processing.Remove(task);
try
{
var container = await task;
IXRefContainer container = await task;
if (!container.IsEmbeddedRedirections)
{
AddToDownloadList(
Expand Down
2 changes: 2 additions & 0 deletions src/Docfx.Build.Engine/XRefMaps/XRefMapDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected static IXRefContainer DownloadFromLocal(Uri uri)

private static IXRefContainer ReadLocalFile(string filePath)
{
Logger.LogVerbose($"Reading from file: {filePath}");
if (".zip".Equals(Path.GetExtension(filePath), StringComparison.OrdinalIgnoreCase))
{
return XRefArchive.Open(filePath, XRefArchiveMode.Read);
Expand All @@ -120,6 +121,7 @@ private static IXRefContainer ReadLocalFile(string filePath)

protected static async Task<XRefMap> DownloadFromWebAsync(Uri uri)
{
Logger.LogVerbose($"Reading from web: {uri.OriginalString}");
var baseUrl = uri.GetLeftPart(UriPartial.Path);
baseUrl = baseUrl.Substring(0, baseUrl.LastIndexOf('/') + 1);

Expand Down