File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,10 @@ public void Execute(CancellationToken cancellationToken)
77
77
_logger . DebugFormat ( "Removing outdated records from table '{0}'..." , table ) ;
78
78
79
79
UseConnectionDistributedLock ( _storage , connection => {
80
- using IDbTransaction transaction = connection . BeginTransaction ( ) ;
81
80
int removedCount ;
82
81
do
83
82
{
83
+ using IDbTransaction transaction = connection . BeginTransaction ( ) ;
84
84
removedCount = connection . Execute ( $@ "
85
85
DELETE FROM ""{ _storage . Options . SchemaName } "".""{ table } ""
86
86
WHERE ""id"" IN (
@@ -95,14 +95,13 @@ DELETE FROM ""{_storage.Options.SchemaName}"".""{table}""
95
95
continue ;
96
96
}
97
97
98
+ transaction . Commit ( ) ;
98
99
_logger . InfoFormat ( "Removed {0} outdated record(s) from '{1}' table." , removedCount , table ) ;
99
100
100
101
cancellationToken . WaitHandle . WaitOne ( _delayBetweenPasses ) ;
101
102
cancellationToken . ThrowIfCancellationRequested ( ) ;
102
103
}
103
104
while ( removedCount != 0 ) ;
104
-
105
- transaction . Commit ( ) ;
106
105
} ) ;
107
106
}
108
107
You can’t perform that action at this time.
0 commit comments