From 29368a1566afcbfa861e3cf431156ee0f73f1f2b Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Mon, 5 Jun 2023 11:46:13 -0500 Subject: Source SQLite cache_size from an Environment Variable (#9666) --- .../Extensions/ConfigurationExtensions.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'MediaBrowser.Controller/Extensions') diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs index 3b5e8ece7..6c58064ce 100644 --- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs +++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs @@ -59,6 +59,11 @@ namespace MediaBrowser.Controller.Extensions /// public const string UnixSocketPermissionsKey = "kestrel:socketPermissions"; + /// + /// The cache size of the SQL database, see cache_size. + /// + public const string SqliteCacheSizeKey = "sqlite:cacheSize"; + /// /// Gets a value indicating whether the application should host static web content from the . /// @@ -115,5 +120,13 @@ namespace MediaBrowser.Controller.Extensions /// The unix socket permissions. public static string? GetUnixSocketPermissions(this IConfiguration configuration) => configuration[UnixSocketPermissionsKey]; + + /// + /// Gets the cache_size from the . + /// + /// The configuration to read the setting from. + /// The sqlite cache size. + public static int? GetSqliteCacheSize(this IConfiguration configuration) + => configuration.GetValue(SqliteCacheSizeKey); } } -- cgit v1.2.3