diff --git a/AsbCloudApp/Services/ITelemetryTracker.cs b/AsbCloudApp/Services/ITelemetryTracker.cs index ac582a52..878f88dd 100644 --- a/AsbCloudApp/Services/ITelemetryTracker.cs +++ b/AsbCloudApp/Services/ITelemetryTracker.cs @@ -4,7 +4,7 @@ namespace AsbCloudApp.Services { public interface ITelemetryTracker { - void SaveRequest(string id); - IEnumerable GetRequests(); + void SaveRequestDate(string uid); + IEnumerable GetRequestUids(); } } diff --git a/AsbCloudInfrastructure/Services/TelemetryTracker.cs b/AsbCloudInfrastructure/Services/TelemetryTracker.cs index 21e172c1..a2b5d08b 100644 --- a/AsbCloudInfrastructure/Services/TelemetryTracker.cs +++ b/AsbCloudInfrastructure/Services/TelemetryTracker.cs @@ -10,20 +10,20 @@ namespace AsbCloudInfrastructure.Services private IDictionary requests = new Dictionary(); 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 GetRequests() + public IEnumerable GetRequestUids() { - DeleteOldRequests(); + DeleteOldRequestDates(); return requests.Keys; } }