Skip to content

Commit 836b1c1

Browse files
iammukeshmclaude
andcommitted
fix(build): suppress CA1812 on DI-instantiated HangfireStaleLockCleanupService
The class is registered via AddHostedService but CA1812 doesn't recognize DI-based instantiation of internal classes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 12c47a5 commit 836b1c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/BuildingBlocks/Jobs/HangfireStaleLockCleanupService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace FSH.Framework.Jobs;
1010
/// Best-effort cleanup of stale Hangfire locks from crashed instances.
1111
/// Runs as a BackgroundService so it never blocks application startup.
1212
/// </summary>
13+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated by DI via AddHostedService")]
1314
internal sealed class HangfireStaleLockCleanupService : BackgroundService
1415
{
1516
private readonly IConfiguration _configuration;

0 commit comments

Comments
 (0)