diff --git a/AsbCloudApp/Services/ITelemetryTracker.cs b/AsbCloudApp/Services/ITelemetryTracker.cs index 878f88dd..36f21b8b 100644 --- a/AsbCloudApp/Services/ITelemetryTracker.cs +++ b/AsbCloudApp/Services/ITelemetryTracker.cs @@ -5,6 +5,6 @@ namespace AsbCloudApp.Services public interface ITelemetryTracker { void SaveRequestDate(string uid); - IEnumerable GetRequestUids(); + IEnumerable GetTransmittingTelemetryUids(); } } diff --git a/AsbCloudInfrastructure/Services/TelemetryTracker.cs b/AsbCloudInfrastructure/Services/TelemetryTracker.cs index a2b5d08b..21472af1 100644 --- a/AsbCloudInfrastructure/Services/TelemetryTracker.cs +++ b/AsbCloudInfrastructure/Services/TelemetryTracker.cs @@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services DeleteOldRequestDates(); } - public IEnumerable GetRequestUids() + public IEnumerable GetTransmittingTelemetryUids() { DeleteOldRequestDates(); return requests.Keys; diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 2557d23f..83df1397 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services public IEnumerable GetTransmittingWells(int idCustomer) { var wells = new List(); - IEnumerable activeTelemetriesUids = telemetryTracker.GetRequests(); + IEnumerable activeTelemetriesUids = telemetryTracker.GetTransmittingTelemetryUids(); if (activeTelemetriesUids.Count() > 0) { wells = db.GetWellsByCustomer(idCustomer) diff --git a/AsbCloudWebApi/Controllers/TelemetryController.cs b/AsbCloudWebApi/Controllers/TelemetryController.cs index b4e26367..128d7751 100644 --- a/AsbCloudWebApi/Controllers/TelemetryController.cs +++ b/AsbCloudWebApi/Controllers/TelemetryController.cs @@ -53,7 +53,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostInfo(string uid, [FromBody] TelemetryInfoDto info) { telemetryService.UpdateInfo(uid, info); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers if (wellId != null && dtos.Any()) Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveDataSaub), dtos)); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -93,7 +93,7 @@ namespace AsbCloudWebApi.Controllers if (dtos.Any()) Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveMessages), dtos)); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -108,7 +108,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostEvents(string uid, [FromBody] List events) { eventService.Upsert(uid, events); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -123,7 +123,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostUsers(string uid, [FromBody] List users) { telemetryUserService.Upsert(uid, users); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); }