CS2-6: В TelemetryTracker изменены имена методов

This commit is contained in:
KharchenkoVV 2021-05-14 09:58:02 +05:00
parent dd9c985e65
commit 026fbea529
2 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@ namespace AsbCloudApp.Services
{
public interface ITelemetryTracker
{
void SaveRequest(string id);
IEnumerable<string> GetRequests();
void SaveRequestDate(string uid);
IEnumerable<string> GetRequestUids();
}
}

View File

@ -10,20 +10,20 @@ namespace AsbCloudInfrastructure.Services
private IDictionary<string, DateTime> requests = new Dictionary<string, DateTime>();
private readonly TimeSpan timeout = TimeSpan.FromMinutes(6);
private void DeleteOldRequests()
private void DeleteOldRequestDates()
{
requests = requests.Where(dValue => (DateTime.Now - dValue.Value) < timeout).ToDictionary(dValue => dValue.Key, dValue => dValue.Value);
}
public void SaveRequest(string id)
public void SaveRequestDate(string uid)
{
requests[id] = DateTime.Now;
DeleteOldRequests();
requests[uid] = DateTime.Now;
DeleteOldRequestDates();
}
public IEnumerable<string> GetRequests()
public IEnumerable<string> GetRequestUids()
{
DeleteOldRequests();
DeleteOldRequestDates();
return requests.Keys;
}
}