< Summary

Information
Class: Services.HangfireService.TransactionTimeTrackingCleanupJob
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/HangfireService/TransactionTimeTrackingCleanupJob.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
.ctor(...)100%11100%
ExecuteAsync()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/HangfireService/TransactionTimeTrackingCleanupJob.cs

#LineLine coverage
 1using Hangfire;
 2using Services.TransactionUtilsServices;
 3
 4namespace Services.HangfireService;
 5
 6public class TransactionTimeTrackingCleanupJob
 7{
 8    public const string JobId = "TransactionTimeTrackingCleanupJob";
 9    public const string DefaultCron = "0 * * * *";
 10    public const string QueueName = "main";
 111    private static readonly TimeSpan AbandonAfter = TimeSpan.FromHours(12);
 12
 13    private readonly ITransactionTimeTrackingService _trackingService;
 14
 715    public TransactionTimeTrackingCleanupJob(ITransactionTimeTrackingService trackingService)
 16    {
 717        _trackingService = trackingService;
 718    }
 19
 20    [Queue(QueueName)]
 21    public async Task<string> ExecuteAsync()
 22    {
 723        var marked = await _trackingService.MarkAbandonedAsync(AbandonAfter);
 724        return $"Transaction tracking cleanup completed. Marked abandoned sessions: {marked}. Timeout: {AbandonAfter.Tot
 725    }
 26}