diff --git a/src/Config/ObjectModel/RuntimeConfig.cs b/src/Config/ObjectModel/RuntimeConfig.cs index ed7f9f3cc9..e5e791228b 100644 --- a/src/Config/ObjectModel/RuntimeConfig.cs +++ b/src/Config/ObjectModel/RuntimeConfig.cs @@ -440,4 +440,17 @@ private void SetupDataSourcesUsed() CosmosDataSourceUsed = _dataSourceNameToDataSource.Values.Any (x => x.DatabaseType is DatabaseType.CosmosDB_NoSQL); } + + /// + /// Handles the logic for determining if we are in a scenario where hot reload is possible. + /// Hot reload is currently not available, and so this will always return false. When hot reload + /// becomes an available feature this logic will change to reflect the correct state based on + /// the state of the runtime config and any other relevant factors. + /// + /// True in a scenario that support hot reload, false otherwise. + public static bool IsHotReloadable() + { + // always return false while hot reload is not an available feature. + return false; + } } diff --git a/src/Core/Configurations/RuntimeConfigProvider.cs b/src/Core/Configurations/RuntimeConfigProvider.cs index f92cd85632..58ae65c60a 100644 --- a/src/Core/Configurations/RuntimeConfigProvider.cs +++ b/src/Core/Configurations/RuntimeConfigProvider.cs @@ -93,7 +93,7 @@ public RuntimeConfig GetConfig() /// private bool TrySetupConfigFileWatcher() { - if (!IsLateConfigured && _runtimeConfig is not null && _runtimeConfig.IsDevelopmentMode()) + if (!IsLateConfigured && _runtimeConfig is not null && RuntimeConfig.IsHotReloadable()) { try { diff --git a/src/Service.Tests/Unittests/ConfigFileWatcherUnitTests.cs b/src/Service.Tests/Unittests/ConfigFileWatcherUnitTests.cs index 04873cbc62..000ed09bc2 100644 --- a/src/Service.Tests/Unittests/ConfigFileWatcherUnitTests.cs +++ b/src/Service.Tests/Unittests/ConfigFileWatcherUnitTests.cs @@ -65,8 +65,11 @@ HostMode mode /// Use the file system (not mocked) to create a hot reload /// scenario of the REST runtime options and verify that we /// correctly hot reload those options. + /// NOTE: This test is ignored until we have the possibility of turning + /// on hot reload. /// [TestMethod] + [Ignore] public void HotReloadConfigRestRuntimeOptions() { // Arrange