aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Activity/ActivityRepository.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-21 12:29:18 -0500
committerGitHub <noreply@github.com>2016-11-21 12:29:18 -0500
commitf80cc1bbd4145a682234d4d1d286c70f562f36bd (patch)
tree2ecc0e11aa1f394295f6269069da5ed6b9ed0667 /Emby.Server.Implementations/Activity/ActivityRepository.cs
parentb2ea3272e70a0f520133ee6a74d958e044d4392e (diff)
parent1acebd992229ee9bd6e7677f68174672fae53622 (diff)
Merge pull request #2299 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Activity/ActivityRepository.cs')
-rw-r--r--Emby.Server.Implementations/Activity/ActivityRepository.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs
index d730e420a..eef9792de 100644
--- a/Emby.Server.Implementations/Activity/ActivityRepository.cs
+++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs
@@ -27,6 +27,13 @@ namespace Emby.Server.Implementations.Activity
{
using (var connection = CreateConnection())
{
+ connection.ExecuteAll(string.Join(";", new[]
+ {
+ "PRAGMA page_size=4096",
+ "pragma default_temp_store = memory",
+ "pragma temp_store = memory"
+ }));
+
string[] queries = {
"create table if not exists ActivityLogEntries (Id GUID PRIMARY KEY, Name TEXT, Overview TEXT, ShortOverview TEXT, Type TEXT, ItemId TEXT, UserId TEXT, DateCreated DATETIME, LogSeverity TEXT)",
@@ -51,9 +58,9 @@ namespace Emby.Server.Implementations.Activity
throw new ArgumentNullException("entry");
}
- using (WriteLock.Write())
+ using (var connection = CreateConnection())
{
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
connection.RunInTransaction(db =>
{
@@ -79,9 +86,9 @@ namespace Emby.Server.Implementations.Activity
public QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit)
{
- using (WriteLock.Read())
+ using (var connection = CreateConnection(true))
{
- using (var connection = CreateConnection(true))
+ using (WriteLock.Read())
{
var commandText = BaseActivitySelectText;
var whereClauses = new List<string>();