From b233b48336297001e8df1f99f02796a6842bda9c Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Sat, 1 Aug 2020 20:08:27 +0300 Subject: [PATCH] Add async modifier in Sensors.Modules.*GrpcService --- NucuCar.Sensors/Modules/Environment/Bme680GrpcService.cs | 6 +++--- NucuCar.Sensors/Modules/Health/CpuTempGrpcService.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NucuCar.Sensors/Modules/Environment/Bme680GrpcService.cs b/NucuCar.Sensors/Modules/Environment/Bme680GrpcService.cs index b336937..c3cbf71 100644 --- a/NucuCar.Sensors/Modules/Environment/Bme680GrpcService.cs +++ b/NucuCar.Sensors/Modules/Environment/Bme680GrpcService.cs @@ -26,16 +26,16 @@ namespace NucuCar.Sensors.Modules.Environment _options = options; } - public override Task GetMeasurement(Empty request, + public override async Task GetMeasurement(Empty request, ServerCallContext context) { _logger?.LogDebug($"Calling {nameof(GetMeasurement)}."); if (_options.Value.Grpc) { - return Task.FromResult(_bme680Sensor.Object.GetMeasurement()); + return await Task.FromResult(_bme680Sensor.Object.GetMeasurement()); } - return Task.FromResult(Responses.GrpcIsDisabledResponse); + return await Task.FromResult(Responses.GrpcIsDisabledResponse); } } } \ No newline at end of file diff --git a/NucuCar.Sensors/Modules/Health/CpuTempGrpcService.cs b/NucuCar.Sensors/Modules/Health/CpuTempGrpcService.cs index 5118de4..4251cdc 100644 --- a/NucuCar.Sensors/Modules/Health/CpuTempGrpcService.cs +++ b/NucuCar.Sensors/Modules/Health/CpuTempGrpcService.cs @@ -23,15 +23,15 @@ namespace NucuCar.Sensors.Modules.Health _options = options; } - public override Task GetCpuTemperature(Empty request, ServerCallContext context) + public override async Task GetCpuTemperature(Empty request, ServerCallContext context) { _logger?.LogDebug($"Calling {nameof(GetCpuTemperature)}."); if (_options.Value.Grpc) { - return Task.FromResult(_sensor.Object.GetMeasurement()); + return await Task.FromResult(_sensor.Object.GetMeasurement()); } - return Task.FromResult(Responses.GrpcIsDisabledResponse); + return await Task.FromResult(Responses.GrpcIsDisabledResponse); } } } \ No newline at end of file