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;
|
var feature = cached;
|
||||||
if (feature == null)
|
if (feature == null || cleared)
|
||||||
{
|
{
|
||||||
feature = Collection.Get<TFeature>();
|
feature = Collection.Get<TFeature>();
|
||||||
if (feature == null)
|
if (feature == null)
|
||||||
|
|
@ -45,10 +45,7 @@ namespace Microsoft.AspNetCore.Http.Features
|
||||||
feature = factory(state);
|
feature = factory(state);
|
||||||
|
|
||||||
Collection.Set(feature);
|
Collection.Set(feature);
|
||||||
if (!cleared)
|
|
||||||
{
|
|
||||||
Cache = default(TCache);
|
|
||||||
}
|
|
||||||
Revision = Collection.Revision;
|
Revision = Collection.Revision;
|
||||||
}
|
}
|
||||||
cached = feature;
|
cached = feature;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue