aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Persistence
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-12-09 09:24:21 -0500
committerEric Reed <ebr@mediabrowser3.com>2013-12-09 09:24:21 -0500
commit83c4d75b1484ad7e7aa99a1abba8b7903391ec95 (patch)
tree00d426fd355a6bb0a0d1ac5276034691349b5f59 /MediaBrowser.Server.Implementations/Persistence
parentbec5a4f561974941ed07638d3e1fb8a974ac0cc5 (diff)
parent41ed3c15ffee7430b0718114bc7732f354198fb7 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/Persistence')
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs10
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteProviderInfoRepository.cs10
2 files changed, 20 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs
index 075ef42398..5842b05a34 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs
@@ -32,6 +32,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
_logger = logManager.GetLogger(GetType().Name);
}
+ private SqliteShrinkMemoryTimer _shrinkMemoryTimer;
+
/// <summary>
/// Opens the connection to the database
/// </summary>
@@ -52,6 +54,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.RunQueries(queries, _logger);
PrepareStatements();
+
+ _shrinkMemoryTimer = new SqliteShrinkMemoryTimer(_connection, _writeLock, _logger);
}
/// <summary>
@@ -282,6 +286,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
{
lock (_disposeLock)
{
+ if (_shrinkMemoryTimer != null)
+ {
+ _shrinkMemoryTimer.Dispose();
+ _shrinkMemoryTimer = null;
+ }
+
if (_connection != null)
{
if (_connection.IsOpen())
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteProviderInfoRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteProviderInfoRepository.cs
index 5d836b090d..9971c74605 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteProviderInfoRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteProviderInfoRepository.cs
@@ -25,6 +25,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
_logger = logManager.GetLogger(GetType().Name);
}
+ private SqliteShrinkMemoryTimer _shrinkMemoryTimer;
+
/// <summary>
/// Opens the connection to the database
/// </summary>
@@ -50,6 +52,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.RunQueries(queries, _logger);
PrepareStatements();
+
+ _shrinkMemoryTimer = new SqliteShrinkMemoryTimer(_connection, _writeLock, _logger);
}
private static readonly string[] SaveColumns =
@@ -240,6 +244,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
{
lock (_disposeLock)
{
+ if (_shrinkMemoryTimer != null)
+ {
+ _shrinkMemoryTimer.Dispose();
+ _shrinkMemoryTimer = null;
+ }
+
if (_connection != null)
{
if (_connection.IsOpen())