forked from ddrilling/AsbCloudServer
CS2-6: В TelemetryTracker изменены имена методов
This commit is contained in:
parent
dd9c985e65
commit
026fbea529
@ -4,7 +4,7 @@ namespace AsbCloudApp.Services
|
||||
{
|
||||
public interface ITelemetryTracker
|
||||
{
|
||||
void SaveRequest(string id);
|
||||
IEnumerable<string> GetRequests();
|
||||
void SaveRequestDate(string uid);
|
||||
IEnumerable<string> GetRequestUids();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user