Skip to content

Commit d76b29a

Browse files
committed
refactor(auth): 🔨 relocate attribute declarations in BackgroundRefresher
Positioned the instance variable initializations earlier in the constructor to establish clear variable declarations at the outset of the method. This adjustment enhances code predictability by ensuring all attributes are defined before any complex logic execution.
1 parent 1456ae3 commit d76b29a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rotator_library/background_refresher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class BackgroundRefresher:
1818
"""
1919

2020
def __init__(self, client: "RotatingClient"):
21+
self._client = client
22+
self._task: Optional[asyncio.Task] = None
23+
self._initialized = False
2124
try:
2225
interval_str = os.getenv("OAUTH_REFRESH_INTERVAL", "600")
2326
self._interval = int(interval_str)
@@ -26,9 +29,6 @@ def __init__(self, client: "RotatingClient"):
2629
f"Invalid OAUTH_REFRESH_INTERVAL '{interval_str}'. Falling back to 600s."
2730
)
2831
self._interval = 600
29-
self._client = client
30-
self._task: Optional[asyncio.Task] = None
31-
self._initialized = False
3232

3333
def start(self):
3434
"""Starts the background refresh task."""

0 commit comments

Comments
 (0)