@@ -58,31 +58,31 @@ private static async Task<IResult> GetBasicHealthAsync(
5858 try
5959 {
6060 var healthReport = await healthCheckService . CheckHealthAsync ( cancellationToken ) ;
61-
61+
6262 var response = new HealthCheckResponse
6363 {
6464 Status = healthReport . Status . ToString ( ) ,
6565 TotalDuration = healthReport . TotalDuration
6666 } ;
6767
68- var statusCode = healthReport . Status == HealthStatus . Healthy
69- ? StatusCodes . Status200OK
68+ var statusCode = healthReport . Status == HealthStatus . Healthy
69+ ? StatusCodes . Status200OK
7070 : StatusCodes . Status503ServiceUnavailable ;
7171
7272 logger . LogInformation ( "Health check completed with status: {Status}" , healthReport . Status ) ;
73-
73+
7474 return Results . Json ( response , statusCode : statusCode ) ;
7575 }
7676 catch ( Exception ex )
7777 {
7878 logger . LogError ( ex , "Health check failed with exception" ) ;
79-
79+
8080 var response = new HealthCheckResponse
8181 {
8282 Status = "Unhealthy" ,
8383 TotalDuration = TimeSpan . Zero
8484 } ;
85-
85+
8686 return Results . Json ( response , statusCode : StatusCodes . Status503ServiceUnavailable ) ;
8787 }
8888 }
@@ -97,7 +97,7 @@ private static async Task<IResult> GetDetailedHealthAsync(
9797 try
9898 {
9999 var healthReport = await healthCheckService . CheckHealthAsync ( cancellationToken ) ;
100-
100+
101101 var response = new DetailedHealthCheckResponse
102102 {
103103 Status = healthReport . Status . ToString ( ) ,
@@ -114,19 +114,19 @@ private static async Task<IResult> GetDetailedHealthAsync(
114114 } )
115115 } ;
116116
117- var statusCode = healthReport . Status == HealthStatus . Healthy
118- ? StatusCodes . Status200OK
117+ var statusCode = healthReport . Status == HealthStatus . Healthy
118+ ? StatusCodes . Status200OK
119119 : StatusCodes . Status503ServiceUnavailable ;
120120
121- logger . LogInformation ( "Detailed health check completed with status: {Status}, Entries: {EntryCount}" ,
121+ logger . LogInformation ( "Detailed health check completed with status: {Status}, Entries: {EntryCount}" ,
122122 healthReport . Status , healthReport . Entries . Count ) ;
123-
123+
124124 return Results . Json ( response , statusCode : statusCode ) ;
125125 }
126126 catch ( Exception ex )
127127 {
128128 logger . LogError ( ex , "Detailed health check failed with exception" ) ;
129-
129+
130130 var response = new DetailedHealthCheckResponse
131131 {
132132 Status = "Unhealthy" ,
@@ -142,7 +142,7 @@ private static async Task<IResult> GetDetailedHealthAsync(
142142 }
143143 }
144144 } ;
145-
145+
146146 return Results . Json ( response , statusCode : StatusCodes . Status503ServiceUnavailable ) ;
147147 }
148148 }
0 commit comments