File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Threading . Tasks ;
2
3
using cartservice . interfaces ;
4
+ using Grpc . Core ;
3
5
using Grpc . Health . V1 ;
4
6
using StackExchange . Redis ;
5
7
using static Grpc . Health . V1 . Health ;
@@ -11,12 +13,12 @@ public HealthImpl (ICartStore dependency) {
11
13
this . dependency = dependency ;
12
14
}
13
15
14
- public HealthCheckResponse Check ( HealthCheckRequest request ) {
16
+ public override Task < HealthCheckResponse > Check ( HealthCheckRequest request , ServerCallContext context ) {
15
17
Console . WriteLine ( "Checking CartService Health" ) ;
16
18
17
- return new HealthCheckResponse {
19
+ return Task . FromResult ( new HealthCheckResponse {
18
20
Status = dependency . Ping ( ) ? HealthCheckResponse . Types . ServingStatus . Serving : HealthCheckResponse . Types . ServingStatus . NotServing
19
- } ;
21
+ } ) ;
20
22
}
21
23
}
22
- }
24
+ }
Original file line number Diff line number Diff line change 10
10
<PackageReference Include =" Google.Protobuf" Version =" 3.6.1" />
11
11
<PackageReference Include =" Google.Protobuf.Tools" Version =" 3.5.1" />
12
12
<PackageReference Include =" grpc" Version =" 1.12.0" />
13
- <PackageReference Include =" Grpc.HealthCheck" Version =" 1.15 .0" />
13
+ <PackageReference Include =" Grpc.HealthCheck" Version =" 1.12 .0" />
14
14
<PackageReference Include =" grpc.tools" Version =" 1.12.0" />
15
15
<PackageReference Include =" Microsoft.Extensions.Configuration" Version =" 2.1.1" />
16
16
<PackageReference Include =" Microsoft.Extensions.Configuration.Json" Version =" 2.1.1" />
You can’t perform that action at this time.
0 commit comments