diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs b/MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs index f9c892b76..eec5b4b76 100644 --- a/MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs @@ -20,9 +20,22 @@ namespace MediaBrowser.Server.Implementations.Persistence Logger = logManager.GetLogger(GetType().Name); } - protected Task<IDbConnection> CreateConnection(bool isReadOnly = false) + protected virtual bool EnableConnectionPooling { - return DbConnector.Connect(DbFilePath, false, true); + get { return true; } + } + + protected virtual async Task<IDbConnection> CreateConnection(bool isReadOnly = false) + { + var connection = await DbConnector.Connect(DbFilePath, false, true).ConfigureAwait(false); + + connection.RunQueries(new[] + { + "pragma temp_store = memory" + + }, Logger); + + return connection; } private bool _disposed; @@ -95,7 +108,7 @@ namespace MediaBrowser.Server.Implementations.Persistence protected virtual void CloseConnection() { - + } } -} +}
\ No newline at end of file |
