Backend/e-suite.Service.Sentinel/e-suite.Service.Sentinel/SentinelMaintenance.cs
2026-01-20 21:50:10 +00:00

20 lines
802 B
C#

using e_suite.API.Common.repository;
using eSuite.Core.Clock;
using Microsoft.Extensions.Configuration;
namespace e_suite.Service.Sentinel;
public class SentinelMaintenance : SentinelBase, ISentinelMaintenance
{
public SentinelMaintenance(IClock clock, IConfiguration configuration, ISentinelRepository sentinelRepository) : base(clock, configuration, sentinelRepository)
{
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Leaving the variable name is clearer")]
public async Task ClearOldSentinelData()
{
var (earliestAttemptTime, maxLoginAttempts) = GetLoginAttemptConstraints();
await SentinelRepository.DeleteAccessAttemptsBefore(earliestAttemptTime);
}
}