refactor(llm-gateway): adjust if-condition formatting for thread safety check
Updated line breaks and indentation for improved readability in circuit state recovery logic, ensuring consistent style.
This commit is contained in:
@@ -111,7 +111,10 @@ class CircuitBreaker:
|
|||||||
if self._state == CircuitState.OPEN:
|
if self._state == CircuitState.OPEN:
|
||||||
time_in_open = time.time() - self._stats.state_changed_at
|
time_in_open = time.time() - self._stats.state_changed_at
|
||||||
# Double-check state after time calculation (for thread safety)
|
# Double-check state after time calculation (for thread safety)
|
||||||
if time_in_open >= self.recovery_timeout and self._state == CircuitState.OPEN:
|
if (
|
||||||
|
time_in_open >= self.recovery_timeout
|
||||||
|
and self._state == CircuitState.OPEN
|
||||||
|
):
|
||||||
self._transition_to(CircuitState.HALF_OPEN)
|
self._transition_to(CircuitState.HALF_OPEN)
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Circuit {self.name} transitioned to HALF_OPEN "
|
f"Circuit {self.name} transitioned to HALF_OPEN "
|
||||||
|
|||||||
Reference in New Issue
Block a user