diff options
| author | Mark Lopez <m@silvenga.com> | 2023-06-05 11:46:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-05 10:46:13 -0600 |
| commit | 29368a1566afcbfa861e3cf431156ee0f73f1f2b (patch) | |
| tree | 8d9825575c67c3d96b7e9e400b62ae0dd18f5d82 /MediaBrowser.Controller/Extensions | |
| parent | aae22865a035219daff37ef3bb7c101dd9d15e82 (diff) | |
Source SQLite cache_size from an Environment Variable (#9666)
Diffstat (limited to 'MediaBrowser.Controller/Extensions')
| -rw-r--r-- | MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ -60,6 +60,11 @@ namespace MediaBrowser.Controller.Extensions public const string UnixSocketPermissionsKey = "kestrel:socketPermissions"; /// <summary> + /// The cache size of the SQL database, see cache_size. + /// </summary> + public const string SqliteCacheSizeKey = "sqlite:cacheSize"; + + /// <summary> /// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>. /// </summary> /// <param name="configuration">The configuration to retrieve the value from.</param> @@ -115,5 +120,13 @@ namespace MediaBrowser.Controller.Extensions /// <returns>The unix socket permissions.</returns> public static string? GetUnixSocketPermissions(this IConfiguration configuration) => configuration[UnixSocketPermissionsKey]; + + /// <summary> + /// Gets the cache_size from the <see cref="IConfiguration" />. + /// </summary> + /// <param name="configuration">The configuration to read the setting from.</param> + /// <returns>The sqlite cache size.</returns> + public static int? GetSqliteCacheSize(this IConfiguration configuration) + => configuration.GetValue<int?>(SqliteCacheSizeKey); } } |
