Reduce cognitive complexity in circuit breaker decorators #63
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/63/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
circuit_breaker_decorator and circuit_protected_call both scored 17 (threshold: 15) due to deeply nested closures. Extracted four module-level helpers (_run_protected_async, _run_protected_sync, _run_decorated_async, _run_decorated_sync) that hold the actual execution logic; the decorator factories become thin dispatchers. Both functions now score 2. No behaviour change — all 170 tests pass.
Closes #62