Skip to content

Commit aebd088

Browse files
committed
fix: ruff?
1 parent b48115c commit aebd088

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

openfga_sdk/oauth2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ async def _obtain_token(self, client):
152152
if api_response.get("expires_in") and api_response.get("access_token"):
153153
self._token_state = _TokenState(
154154
access_token=api_response.get("access_token"),
155-
expiry_time=datetime.now() + timedelta(
156-
seconds=int(api_response.get("expires_in"))
157-
),
155+
expiry_time=datetime.now()
156+
+ timedelta(seconds=int(api_response.get("expires_in"))),
158157
expiry_buffer=(
159158
TOKEN_EXPIRY_THRESHOLD_BUFFER_IN_SEC
160159
+ random.random() * TOKEN_EXPIRY_JITTER_IN_SEC

openfga_sdk/sync/oauth2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ def _obtain_token(self, client):
153153
if api_response.get("expires_in") and api_response.get("access_token"):
154154
self._token_state = _TokenState(
155155
access_token=api_response.get("access_token"),
156-
expiry_time=datetime.now() + timedelta(
157-
seconds=int(api_response.get("expires_in"))
158-
),
156+
expiry_time=datetime.now()
157+
+ timedelta(seconds=int(api_response.get("expires_in"))),
159158
expiry_buffer=(
160159
TOKEN_EXPIRY_THRESHOLD_BUFFER_IN_SEC
161160
+ random.random() * TOKEN_EXPIRY_JITTER_IN_SEC

0 commit comments

Comments
 (0)