diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-06-12 19:35:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-12 19:35:22 -0400 |
| commit | f838ae0a465c5a788637ff30062a706fd26a0876 (patch) | |
| tree | 1a2cc7c2a18795dbec0bd1951ec1ec6d223a5289 /MediaBrowser.Server.Implementations/Persistence/BaseSqliteRepository.cs | |
| parent | 1ffd09b23d890bd84d682ce294ac14c318e687c0 (diff) | |
| parent | 383110f9af6b5ad79ddabb3c8db0bdb7d4b4db03 (diff) | |
Merge pull request #1838 from MediaBrowser/dev
Dev
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 |
