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
|
public interface ITelemetryTracker
|
||||||
{
|
{
|
||||||
void SaveRequest(string id);
|
void SaveRequestDate(string uid);
|
||||||
IEnumerable<string> GetRequests();
|
IEnumerable<string> GetRequestUids();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,20 +10,20 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
private IDictionary<string, DateTime> requests = new Dictionary<string, DateTime>();
|
private IDictionary<string, DateTime> requests = new Dictionary<string, DateTime>();
|
||||||
private readonly TimeSpan timeout = TimeSpan.FromMinutes(6);
|
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);
|
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;
|
requests[uid] = DateTime.Now;
|
||||||
DeleteOldRequests();
|
DeleteOldRequestDates();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<string> GetRequests()
|
public IEnumerable<string> GetRequestUids()
|
||||||
{
|
{
|
||||||
DeleteOldRequests();
|
DeleteOldRequestDates();
|
||||||
return requests.Keys;
|
return requests.Keys;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user