python/ray/serve/deployment_state.py
def _should_start_new_health_check(self) -> bool:
        """Determines if a new health check should be kicked off.

        A health check will be started if:
            1) There is not already an active health check.
            2) It has been more than self._health_check_period_s since the
               previous health check was *started*.

        This assumes that self._health_check_ref is reset to `None` when an
        active health check succeeds or fails (due to returning or timeout).
        """
        if self._health_check_ref is not None:
            # There's already an active health check.
            return False

        # If there's no active health check, kick off another and reset
        # the timer if it's been long enough since the last health
        # check. Add some randomness to avoid synchronizing across all
        # replicas.
        time_since_last = time.time() - self._last_health_check_time
        randomized_period = self._health_check_period_s * random.uniform(0.9, 1.1)
        return time_since_last > randomized_period
Determines if a new health check should be kicked off.

        A health check will be started if:
            1) There is not already an active health check.
            2) It has been more than self._health_check_period_s since the
               previous health check was *started*.

        This assumes that self._health_check_ref is reset to `None` when an
        active health check succeeds or fails (due to returning or timeout).
        
Determines if a new health check should be kicked off.
A health check will be started if:
1) There is not already an active health check.
2) It has been more than self._health_check_period_s since the
previous health check was *started*.

This assumes that self._health_check_ref is reset to `None` when an
active health check succeeds or fails (due to returning or timeout).
Determines if a new health check should be kicked off . A health check will be started if : 1 ) There is not already an active health check . 2 ) It has been more than self . _health_check_period_s since the previous health check was * started * . This assumes that self . _health_check_ref is reset to ` None ` when an active health check succeeds or fails ( due to returning or timeout ) .
def _should_start_new_health_check(self) -> bool:
        if self._health_check_ref is not None:
            return False
        time_since_last = time.time() - self._last_health_check_time
        randomized_period = self._health_check_period_s * random.uniform(0.9, 1.1)
        return time_since_last > randomized_period
def _should_start_new_health_check ( self ) -> bool : if self . _health_check_ref is not None : return False time_since_last = time . time ( ) - self . _last_health_check_time randomized_period = self . _health_check_period_s * random . uniform ( 0.9 , 1.1 ) return time_since_last > randomized_period
Determines if a new health check should be kicked off.
Determines if a new health check should be kicked off .
"""Determines if a new health check should be kicked off.

        A health check will be started if:
            1) There is not already an active health check.
            2) It has been more than self._health_check_period_s since the
               previous health check was *started*.

        This assumes that self._health_check_ref is reset to `None` when an
        active health check succeeds or fails (due to returning or timeout).
        """ # There's already an active health check. # If there's no active health check, kick off another and reset # the timer if it's been long enough since the last health # check. Add some randomness to avoid synchronizing across all # replicas.
self