parent
c66c408c15
commit
efb8ef33e6
|
|
@ -147,21 +147,21 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify all other awaiters of the final content
|
|
||||||
tcs.TrySetResult(content);
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// Notify all other awaiters to render the content
|
content = null;
|
||||||
tcs.TrySetResult(null);
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
// Remove the worker task from the in-memory cache
|
// Remove the worker task before setting the result.
|
||||||
Task<IHtmlContent> worker;
|
// If the result is null, other threads would potentially
|
||||||
_workers.TryRemove(key, out worker);
|
// acquire it otherwise.
|
||||||
|
_workers.TryRemove(key, out result);
|
||||||
|
|
||||||
|
// Notify all other awaiters to render the content
|
||||||
|
tcs.TrySetResult(content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue