Stop injecting the runtime cache, use AppCaches

This commit is contained in:
Stephan
2019-01-17 11:19:06 +01:00
parent 0bee01e0ee
commit d4c714eccd
19 changed files with 48 additions and 62 deletions

View File

@@ -6,9 +6,9 @@ namespace Umbraco.Core.Configuration.Grid
{
class GridConfig : IGridConfig
{
public GridConfig(ILogger logger, IAppPolicedCache runtimeCache, DirectoryInfo configFolder, bool isDebug)
public GridConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, bool isDebug)
{
EditorsConfig = new GridEditorsConfig(logger, runtimeCache, configFolder, isDebug);
EditorsConfig = new GridEditorsConfig(logger, appCaches, configFolder, isDebug);
}
public IGridEditorsConfig EditorsConfig { get; }

View File

@@ -13,14 +13,14 @@ namespace Umbraco.Core.Configuration.Grid
internal class GridEditorsConfig : IGridEditorsConfig
{
private readonly ILogger _logger;
private readonly IAppPolicedCache _runtimeCache;
private readonly AppCaches _appCaches;
private readonly DirectoryInfo _configFolder;
private readonly bool _isDebug;
public GridEditorsConfig(ILogger logger, IAppPolicedCache runtimeCache, DirectoryInfo configFolder, bool isDebug)
public GridEditorsConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, bool isDebug)
{
_logger = logger;
_runtimeCache = runtimeCache;
_appCaches = appCaches;
_configFolder = configFolder;
_isDebug = isDebug;
}
@@ -32,7 +32,7 @@ namespace Umbraco.Core.Configuration.Grid
List<GridEditor> GetResult()
{
// fixme - should use the common one somehow! + ignoring _appPlugins here!
var parser = new ManifestParser(_runtimeCache, Current.ManifestValidators, _logger);
var parser = new ManifestParser(_appCaches, Current.ManifestValidators, _logger);
var editors = new List<GridEditor>();
var gridConfig = Path.Combine(_configFolder.FullName, "grid.editors.config.js");
@@ -62,7 +62,7 @@ namespace Umbraco.Core.Configuration.Grid
//cache the result if debugging is disabled
var result = _isDebug
? GetResult()
: _runtimeCache.GetCacheItem<List<GridEditor>>(typeof(GridEditorsConfig) + ".Editors",GetResult, TimeSpan.FromMinutes(10));
: _appCaches.RuntimeCache.GetCacheItem<List<GridEditor>>(typeof(GridEditorsConfig) + ".Editors",GetResult, TimeSpan.FromMinutes(10));
return result;
}