dont reload appsettings.json at runtime (#2093)

* dont reload appsettings.json at runtime

* also disable here
This commit is contained in:
Jason Dove
2025-06-29 17:15:34 +00:00
committed by GitHub
parent 7457301d3e
commit cd28afcd91
4 changed files with 11 additions and 3 deletions
+1
View File
@@ -57,6 +57,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Allow `Other Video` libraries and `Image` libraries to use the same folders
- Try to mitigate inotify limit error by disabling automatic reloading of `appsettings.json` config files
### Fixed
- Fix QSV acceleration in docker with older Intel devices
@@ -137,9 +137,14 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI
var environment = new Dictionary<string, string>();
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
{
if (de is { Key: string key, Value: string value } && key.StartsWith("ETV_", StringComparison.OrdinalIgnoreCase))
if (de is { Key: string key, Value: string value })
{
environment[key] = value;
if (key.StartsWith("ETV_", StringComparison.OrdinalIgnoreCase)
|| key.StartsWith("DOTNET_", StringComparison.OrdinalIgnoreCase)
|| key.StartsWith("ASPNETCORE_", StringComparison.OrdinalIgnoreCase))
{
environment[key] = value;
}
}
}
+1
View File
@@ -64,6 +64,7 @@ public class Program
try
{
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
await CreateHostBuilder(args).Build().RunAsync();
return 0;
}
+2 -1
View File
@@ -27,7 +27,7 @@ public class Program
Configuration = builder
.SetBasePath(BasePath)
.AddJsonFile("appsettings.json", false, true)
.AddJsonFile("appsettings.json", false, reloadOnChange: false)
.AddJsonFile(
$"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json",
true)
@@ -117,6 +117,7 @@ public class Program
try
{
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
await CreateHostBuilder(args).Build().RunAsync();
return 0;
}