Cache doesn't need clearing when resolving uncached feature
This commit is contained in:
parent
0aacea0faf
commit
982aa08cda
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Http.Features
|
|||
}
|
||||
|
||||
var feature = cached;
|
||||
if (feature == null)
|
||||
if (feature == null || cleared)
|
||||
{
|
||||
feature = Collection.Get<TFeature>();
|
||||
if (feature == null)
|
||||
|
|
@ -45,10 +45,7 @@ namespace Microsoft.AspNetCore.Http.Features
|
|||
feature = factory(state);
|
||||
|
||||
Collection.Set(feature);
|
||||
if (!cleared)
|
||||
{
|
||||
Cache = default(TCache);
|
||||
}
|
||||
|
||||
Revision = Collection.Revision;
|
||||
}
|
||||
cached = feature;
|
||||
|
|
|
|||
Loading…
Reference in New Issue