Adds some comments and fixme

This commit is contained in:
Shannon
2019-11-19 11:45:21 +11:00
parent 8f48df66d5
commit f71a54ec8f
4 changed files with 19 additions and 9 deletions

View File

@@ -13,11 +13,11 @@ namespace Umbraco.Core.Configuration
/// </remarks>
public class Configs
{
private readonly Func<string, object> _configGetter;
private readonly Func<string, object> _configSectionResolver;
public Configs(Func<string, object> configGetter)
public Configs(Func<string, object> configSectionResolver)
{
_configGetter = configGetter;
_configSectionResolver = configSectionResolver ?? throw new ArgumentNullException(nameof(configSectionResolver));
}
private readonly Dictionary<Type, Lazy<object>> _configs = new Dictionary<Type, Lazy<object>>();
@@ -89,7 +89,7 @@ namespace Umbraco.Core.Configuration
using (new SafeCallContext())
{
if ((_configGetter(sectionName) is TConfig config))
if ((_configSectionResolver(sectionName) is TConfig config))
return config;
var ex = new InvalidOperationException($"Could not get configuration section \"{sectionName}\" from config files.");
throw ex;

View File

@@ -2,7 +2,16 @@ namespace Umbraco.Core.Configuration
{
public interface ICoreDebug
{
/// <summary>
/// When set to true, Scope logs the stack trace for any scope that gets disposed without being completed.
/// this helps troubleshooting rogue scopes that we forget to complete
/// </summary>
bool LogUncompletedScopes { get; }
/// <summary>
/// When set to true, the Logger creates a mini dump of w3wp in ~/App_Data/MiniDump whenever it logs
/// an error due to a ThreadAbortException that is due to a timeout.
/// </summary>
bool DumpOnTimeoutThreadAbort { get; }
}
}
}

View File

@@ -5,6 +5,9 @@
/// </summary>
public interface IGlobalSettings
{
// fixme: Review this class, it is now just a dumping ground for config options (based basically on whatever might be in appSettings),
// our config classes should be named according to what they are configuring.
/// <summary>
/// Gets the reserved urls from web.config.
/// </summary>

View File

@@ -12,12 +12,10 @@ namespace Umbraco.Core.Configuration
DumpOnTimeoutThreadAbort = string.Equals("true", appSettings[Constants.AppSettings.Debug.DumpOnTimeoutThreadAbort], StringComparison.OrdinalIgnoreCase);
}
// when true, Scope logs the stack trace for any scope that gets disposed without being completed.
// this helps troubleshooting rogue scopes that we forget to complete
/// <inheritdoc />
public bool LogUncompletedScopes { get; }
// when true, the Logger creates a mini dump of w3wp in ~/App_Data/MiniDump whenever it logs
// an error due to a ThreadAbortException that is due to a timeout.
/// <inheritdoc />
public bool DumpOnTimeoutThreadAbort { get; }
}
}