33import threading
44from datetime import datetime , timezone
55from time import sleep
6- from typing import Any , Awaitable , Callable , Coroutine , Union
6+ from typing import Any , Awaitable , Callable , Union
77
88from redis .auth .err import RequestTokenErr , TokenRenewalErr
99from redis .auth .idp import IdentityProviderInterface
@@ -78,9 +78,9 @@ def __init__(
7878
7979 def get_expiration_refresh_ratio (self ) -> float :
8080 """
81- Represents the ratio of a token's lifetime at which a refresh should be triggered.
82- For example, a value of 0.75 means the token should be refreshed when 75% of its
83- lifetime has elapsed (or when 25% of its lifetime remains).
81+ Represents the ratio of a token's lifetime at which a refresh should be triggered. # noqa: E501
82+ For example, a value of 0.75 means the token should be refreshed
83+ when 75% of its lifetime has elapsed (or when 25% of its lifetime remains).
8484
8585 :return: float
8686 """
@@ -89,9 +89,10 @@ def get_expiration_refresh_ratio(self) -> float:
8989
9090 def get_lower_refresh_bound_millis (self ) -> int :
9191 """
92- Represents the minimum time in milliseconds before token expiration to trigger a refresh, in milliseconds.
93- This value sets a fixed lower bound for when a token refresh should occur, regardless
94- of the token's total lifetime.
92+ Represents the minimum time in milliseconds before token expiration
93+ to trigger a refresh, in milliseconds.
94+ This value sets a fixed lower bound for when a token refresh should occur,
95+ regardless of the token's total lifetime.
9596 If set to 0 there will be no lower bound and the refresh will be triggered
9697 based on the expirationRefreshRatio only.
9798
@@ -101,7 +102,8 @@ def get_lower_refresh_bound_millis(self) -> int:
101102
102103 def get_token_request_execution_timeout_in_ms (self ) -> int :
103104 """
104- Represents the maximum time in milliseconds to wait for a token request to complete.
105+ Represents the maximum time in milliseconds to wait
106+ for a token request to complete.
105107
106108 :return: int
107109 """
0 commit comments