Browse Source

dont reload appsettings.json at runtime (#2093)

* dont reload appsettings.json at runtime

* also disable here
pull/2094/head
Jason Dove 2 months ago committed by GitHub
parent
commit
cd28afcd91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 9
      ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs
  3. 1
      ErsatzTV.Scanner/Program.cs
  4. 3
      ErsatzTV/Program.cs

1
CHANGELOG.md

@ -57,6 +57,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed ### Changed
- Allow `Other Video` libraries and `Image` libraries to use the same folders - 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 ### Fixed
- Fix QSV acceleration in docker with older Intel devices - Fix QSV acceleration in docker with older Intel devices

9
ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs

@ -137,9 +137,14 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI
var environment = new Dictionary<string, string>(); var environment = new Dictionary<string, string>();
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) 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
ErsatzTV.Scanner/Program.cs

@ -64,6 +64,7 @@ public class Program
try try
{ {
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
await CreateHostBuilder(args).Build().RunAsync(); await CreateHostBuilder(args).Build().RunAsync();
return 0; return 0;
} }

3
ErsatzTV/Program.cs

@ -27,7 +27,7 @@ public class Program
Configuration = builder Configuration = builder
.SetBasePath(BasePath) .SetBasePath(BasePath)
.AddJsonFile("appsettings.json", false, true) .AddJsonFile("appsettings.json", false, reloadOnChange: false)
.AddJsonFile( .AddJsonFile(
$"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json",
true) true)
@ -117,6 +117,7 @@ public class Program
try try
{ {
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
await CreateHostBuilder(args).Build().RunAsync(); await CreateHostBuilder(args).Build().RunAsync();
return 0; return 0;
} }

Loading…
Cancel
Save