@@ -143,27 +143,37 @@ impl SystemHealth {
143143 match & self . health_transition_policy {
144144 HealthTransitionPolicy :: Manual => {
145145 // No automatic transition (current behavior)
146- } ,
146+ }
147147 HealthTransitionPolicy :: TimeBasedReady { after_seconds } => {
148148 if uptime. as_secs ( ) >= * after_seconds {
149- tracing:: info!( "Auto-transitioning to ready after {}s uptime (policy: time_based_ready)" , uptime. as_secs( ) ) ;
149+ tracing:: info!(
150+ "Auto-transitioning to ready after {}s uptime (policy: time_based_ready)" ,
151+ uptime. as_secs( )
152+ ) ;
150153 self . system_health = HealthStatus :: Ready ;
151154 }
152- } ,
155+ }
153156 HealthTransitionPolicy :: EndpointBasedReady => {
154157 // Ready when service has registered at least one endpoint
155158 if !self . endpoint_health . is_empty ( ) {
156- let all_endpoints_ready = self . endpoint_health . values ( )
159+ let all_endpoints_ready = self
160+ . endpoint_health
161+ . values ( )
157162 . all ( |status| * status == HealthStatus :: Ready ) ;
158163
159164 if all_endpoints_ready {
160- tracing:: info!( "Auto-transitioning to ready - all {} endpoints are ready (policy: endpoint_based_ready)" ,
161- self . endpoint_health. len( ) ) ;
165+ tracing:: info!(
166+ "Auto-transitioning to ready - all {} endpoints are ready (policy: endpoint_based_ready)" ,
167+ self . endpoint_health. len( )
168+ ) ;
162169 self . system_health = HealthStatus :: Ready ;
163170 }
164171 }
165- } ,
166- HealthTransitionPolicy :: Custom { auto_ready_after_seconds, require_endpoints_ready } => {
172+ }
173+ HealthTransitionPolicy :: Custom {
174+ auto_ready_after_seconds,
175+ require_endpoints_ready,
176+ } => {
167177 let mut ready_conditions_met = true ;
168178
169179 // Check time-based condition if specified
@@ -178,7 +188,9 @@ impl SystemHealth {
178188 if self . endpoint_health . is_empty ( ) {
179189 ready_conditions_met = false ;
180190 } else {
181- let all_endpoints_ready = self . endpoint_health . values ( )
191+ let all_endpoints_ready = self
192+ . endpoint_health
193+ . values ( )
182194 . all ( |status| * status == HealthStatus :: Ready ) ;
183195 if !all_endpoints_ready {
184196 ready_conditions_met = false ;
@@ -187,7 +199,10 @@ impl SystemHealth {
187199 }
188200
189201 if ready_conditions_met {
190- tracing:: info!( "Auto-transitioning to ready after {}s uptime (policy: custom)" , uptime. as_secs( ) ) ;
202+ tracing:: info!(
203+ "Auto-transitioning to ready after {}s uptime (policy: custom)" ,
204+ uptime. as_secs( )
205+ ) ;
191206 self . system_health = HealthStatus :: Ready ;
192207 }
193208 }
0 commit comments