mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-27 11:21:43 +02:00
Close database connections in housekeeping tasks
Co-authored-by: ferencmarkizay <ferencmarkizay@gmail.com>
This commit is contained in:
parent
b48fe6e633
commit
9af6d1b9d9
@ -16,8 +16,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|||||||
|
|
||||||
public void Clean()
|
public void Clean()
|
||||||
{
|
{
|
||||||
var mapper = _database.OpenConnection();
|
using var mapper = _database.OpenConnection();
|
||||||
|
|
||||||
mapper.Execute(@"DELETE FROM PendingReleases
|
mapper.Execute(@"DELETE FROM PendingReleases
|
||||||
WHERE Added < @TwoWeeksAgo
|
WHERE Added < @TwoWeeksAgo
|
||||||
AND REASON IN @Reasons",
|
AND REASON IN @Reasons",
|
||||||
|
@ -14,8 +14,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|||||||
|
|
||||||
public void Clean()
|
public void Clean()
|
||||||
{
|
{
|
||||||
var mapper = _database.OpenConnection();
|
using var mapper = _database.OpenConnection();
|
||||||
|
|
||||||
mapper.Execute(@"DELETE FROM DownloadClientStatus
|
mapper.Execute(@"DELETE FROM DownloadClientStatus
|
||||||
WHERE Id IN (
|
WHERE Id IN (
|
||||||
SELECT DownloadClientStatus.Id FROM DownloadClientStatus
|
SELECT DownloadClientStatus.Id FROM DownloadClientStatus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user