Skip to content

Commit

Permalink
Add Store Name to scopes and template cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorfr committed Jul 6, 2016
1 parent de935ee commit 92dd69d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/GeekLearning.Templating/Internal/TemplateLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public TemplateLoader(IStore store, IEnumerable<ITemplateProvider> providers, IM
//this.scope = memoryCache.GetOrCreateAsync("x_tmpl_inf_scopes", async entry => { })
}

public async Task<ITemplate> GetTemplate(string name)
public Task<ITemplate> GetTemplate(string name)
{
return await this.memoryCache.GetOrCreateAsync($"x_tmpl_{name}", async entry =>
return this.memoryCache.GetOrCreateAsync($"x_tmpl_{this.store.Name}_{name}", async entry =>
{
string directory;
string file;
Expand All @@ -49,9 +49,9 @@ public async Task<ITemplate> GetTemplate(string name)
});
}

private async Task<ITemplateProviderScope> GetScope(ITemplateProvider provider, string name)
private Task<ITemplateProviderScope> GetScope(ITemplateProvider provider, string name)
{
return await this.memoryCache.GetOrCreateAsync($"x_tmpl_inf_scopes_{provider.Extensions.First()}_{name}", async entry =>
return this.memoryCache.GetOrCreateAsync($"x_tmpl_{this.store.Name}_inf_scopes_{provider.Extensions.First()}_{name}", async entry =>
{
entry.SetPriority(CacheItemPriority.High);
var scope = provider.CreateScope();
Expand Down

0 comments on commit 92dd69d

Please sign in to comment.