mirror of
https://github.com/Readarr/Readarr
synced 2025-12-28 19:22:57 +01:00
Close database connections in housekeeping tasks
Co-authored-by: ferencmarkizay <ferencmarkizay@gmail.com>
This commit is contained in:
parent
dea1060d61
commit
595efd498e
2 changed files with 3 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ public CleanupDownloadClientUnavailablePendingReleases(IMainDatabase database)
|
|||
|
||||
public void Clean()
|
||||
{
|
||||
var mapper = _database.OpenConnection();
|
||||
using var mapper = _database.OpenConnection();
|
||||
|
||||
if (_database.DatabaseType == DatabaseType.PostgreSQL)
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ public void Clean()
|
|||
}
|
||||
else
|
||||
{
|
||||
mapper.Execute(@"DELETE FROM ""PendingReleases""
|
||||
mapper.Execute(@"DELETE FROM ""PendingReleases""
|
||||
WHERE ""Added"" < @TwoWeeksAgo
|
||||
AND ""REASON"" IN @Reasons",
|
||||
new
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public CleanupOrphanedDownloadClientStatus(IMainDatabase database)
|
|||
|
||||
public void Clean()
|
||||
{
|
||||
var mapper = _database.OpenConnection();
|
||||
using var mapper = _database.OpenConnection();
|
||||
|
||||
mapper.Execute(@"DELETE FROM ""DownloadClientStatus""
|
||||
WHERE ""Id"" IN (
|
||||
|
|
|
|||
Loading…
Reference in a new issue