1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-03 22:57:18 +02:00

fixup: some tests for log files

This commit is contained in:
Robin Dadswell 2022-11-22 00:05:55 +00:00 committed by Qstick
parent 296ec6c565
commit 5330815e1b
2 changed files with 7 additions and 4 deletions

View File

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

View File

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