fixup: some tests for log files

pull/7773/head
Robin Dadswell 2 years ago committed by Qstick
parent 296ec6c565
commit 5330815e1b

@ -97,6 +97,11 @@ namespace NzbDrone.Core.Instrumentation
WritePostgresLog(log, connectionString); WritePostgresLog(log, connectionString);
} }
} }
catch (NpgsqlException ex)
{
InternalLogger.Error("Unable to save log event to database: {0}", ex);
throw;
}
catch (SQLiteException ex) catch (SQLiteException ex)
{ {
InternalLogger.Error("Unable to save log event to database: {0}", ex); InternalLogger.Error("Unable to save log event to database: {0}", ex);
@ -128,10 +133,8 @@ namespace NzbDrone.Core.Instrumentation
private void WriteSqliteLog(Log log, string connectionString) private void WriteSqliteLog(Log log, string connectionString)
{ {
using (var connection = using (var connection =
new SQLiteConnection(_connectionStringFactory.LogDbConnectionString).OpenAndReturn()) new SQLiteConnection(connectionString).OpenAndReturn())
{ {
connection.ConnectionString = connectionString;
connection.Open();
using (var sqlCommand = connection.CreateCommand()) using (var sqlCommand = connection.CreateCommand())
{ {
sqlCommand.CommandText = INSERT_COMMAND; sqlCommand.CommandText = INSERT_COMMAND;

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;

Loading…
Cancel
Save