Skip to content

Commit 54b0466

Browse files
Suppress timer.Dispose warnings in ETL base classes
Added pragma directives to suppress CA1849 and VSTHRD103 warnings around timer.Dispose() calls in finally blocks of ExtractorBase, LoaderBase, and TransformerBase. This clarifies that disposing the timer without awaiting is intentional and correct in this context.
1 parent 5db11dc commit 54b0466

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/Wolfgang.Etl.Abstractions/ExtractorBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ private async IAsyncEnumerable<TSource> ExtractWithProgressAsync(
278278
}
279279
finally
280280
{
281+
#pragma warning disable CA1849, VSTHRD103 // Timer.Dispose() is correct here; await is not valid in a finally block
281282
timer.Dispose();
283+
#pragma warning restore CA1849, VSTHRD103
282284
progress.Report(CreateProgressReport());
283285
}
284286
}

src/Wolfgang.Etl.Abstractions/LoaderBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ private async Task LoadWithProgressAsync(
280280
}
281281
finally
282282
{
283+
#pragma warning disable CA1849, VSTHRD103 // Timer.Dispose() is correct here; await is not valid in a finally block
283284
timer.Dispose();
285+
#pragma warning restore CA1849, VSTHRD103
284286
progress.Report(CreateProgressReport());
285287
}
286288
}

src/Wolfgang.Etl.Abstractions/TransformerBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ private async IAsyncEnumerable<TDestination> TransformWithProgressAsync(
290290
}
291291
finally
292292
{
293+
#pragma warning disable CA1849, VSTHRD103 // Timer.Dispose() is correct here; await is not valid in a finally block
293294
timer.Dispose();
295+
#pragma warning restore CA1849, VSTHRD103
294296
progress.Report(CreateProgressReport());
295297
}
296298
}

0 commit comments

Comments
 (0)