From f71a54ec8f80a1a6be14a9d64da78033adc33b63 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 19 Nov 2019 11:45:21 +1100 Subject: [PATCH] Adds some comments and fixme --- src/Umbraco.Abstractions/Configuration/Configs.cs | 8 ++++---- src/Umbraco.Abstractions/Configuration/ICoreDebug.cs | 11 ++++++++++- .../Configuration/IGlobalSettings.cs | 3 +++ src/Umbraco.Configuration/CoreDebug.cs | 6 ++---- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Abstractions/Configuration/Configs.cs b/src/Umbraco.Abstractions/Configuration/Configs.cs index 66980d83a6..abb06d525f 100644 --- a/src/Umbraco.Abstractions/Configuration/Configs.cs +++ b/src/Umbraco.Abstractions/Configuration/Configs.cs @@ -13,11 +13,11 @@ namespace Umbraco.Core.Configuration /// public class Configs { - private readonly Func _configGetter; + private readonly Func _configSectionResolver; - public Configs(Func configGetter) + public Configs(Func configSectionResolver) { - _configGetter = configGetter; + _configSectionResolver = configSectionResolver ?? throw new ArgumentNullException(nameof(configSectionResolver)); } private readonly Dictionary> _configs = new Dictionary>(); @@ -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; diff --git a/src/Umbraco.Abstractions/Configuration/ICoreDebug.cs b/src/Umbraco.Abstractions/Configuration/ICoreDebug.cs index 41476f4920..4ff2a1a300 100644 --- a/src/Umbraco.Abstractions/Configuration/ICoreDebug.cs +++ b/src/Umbraco.Abstractions/Configuration/ICoreDebug.cs @@ -2,7 +2,16 @@ namespace Umbraco.Core.Configuration { public interface ICoreDebug { + /// + /// 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 + /// bool LogUncompletedScopes { get; } + + /// + /// 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. + /// bool DumpOnTimeoutThreadAbort { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Abstractions/Configuration/IGlobalSettings.cs b/src/Umbraco.Abstractions/Configuration/IGlobalSettings.cs index 077f853a97..da8b8cd373 100644 --- a/src/Umbraco.Abstractions/Configuration/IGlobalSettings.cs +++ b/src/Umbraco.Abstractions/Configuration/IGlobalSettings.cs @@ -5,6 +5,9 @@ /// 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. + /// /// Gets the reserved urls from web.config. /// diff --git a/src/Umbraco.Configuration/CoreDebug.cs b/src/Umbraco.Configuration/CoreDebug.cs index 43238b2980..0ff3274565 100644 --- a/src/Umbraco.Configuration/CoreDebug.cs +++ b/src/Umbraco.Configuration/CoreDebug.cs @@ -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 + /// 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. + /// public bool DumpOnTimeoutThreadAbort { get; } } }