mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Fixed petapoco's craptastic connection management.
This commit is contained in:
parent
52e6d09325
commit
a5527df584
4 changed files with 47 additions and 27 deletions
28
NzbDrone.Core/Datastore/PetaDbProviderFactory.cs
Normal file
28
NzbDrone.Core/Datastore/PetaDbProviderFactory.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MvcMiniProfiler.Data;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
class PetaDbProviderFactory : DbProviderFactory
|
||||
{
|
||||
public Boolean IsProfiled { get; set; }
|
||||
|
||||
public override DbConnection CreateConnection()
|
||||
{
|
||||
var sqliteConnection = new SqlCeConnection();
|
||||
DbConnection connection = sqliteConnection;
|
||||
|
||||
if (IsProfiled)
|
||||
{
|
||||
connection = ProfiledDbConnection.Get(sqliteConnection);
|
||||
}
|
||||
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue