update components

This commit is contained in:
Luke Pulverenti 2016-07-03 19:05:13 -04:00
parent 338ce07118
commit 373448675b
2 changed files with 9 additions and 3 deletions

View File

@ -192,7 +192,7 @@ namespace MediaBrowser.Model.Configuration
public int MigrationVersion { get; set; } public int MigrationVersion { get; set; }
public int SchemaVersion { get; set; } public int SchemaVersion { get; set; }
public int SqliteCachePages { get; set; } public int SqliteCacheSizeKb { get; set; }
public bool DownloadImagesInAdvance { get; set; } public bool DownloadImagesInAdvance { get; set; }
@ -212,7 +212,7 @@ namespace MediaBrowser.Model.Configuration
{ {
LocalNetworkAddresses = new string[] { }; LocalNetworkAddresses = new string[] { };
Migrations = new string[] { }; Migrations = new string[] { };
SqliteCachePages = 10000; SqliteCacheSizeKb = 50000;
EnableCustomPathSubFolders = true; EnableCustomPathSubFolders = true;
EnableLocalizedGuids = true; EnableLocalizedGuids = true;

View File

@ -123,7 +123,13 @@ namespace MediaBrowser.Server.Implementations.Persistence
protected override async Task<IDbConnection> CreateConnection(bool isReadOnly = false) protected override async Task<IDbConnection> CreateConnection(bool isReadOnly = false)
{ {
var connection = await DbConnector.Connect(DbFilePath, false, false, _config.Configuration.SqliteCachePages).ConfigureAwait(false); var cacheSize = _config.Configuration.SqliteCacheSizeKb;
if (cacheSize <= 0)
{
cacheSize = Math.Min(Environment.ProcessorCount * 50000, 200000);
}
var connection = await DbConnector.Connect(DbFilePath, false, false, 0 - cacheSize).ConfigureAwait(false);
connection.RunQueries(new[] connection.RunQueries(new[]
{ {