Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RLock from Requester #2446

Merged
merged 1 commit into from Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions github/Requester.py
Expand Up @@ -60,7 +60,6 @@
import time
import urllib
from io import IOBase
from multiprocessing import RLock

import requests

Expand Down Expand Up @@ -314,8 +313,6 @@ def __init__(
self.__app_auth = app_auth
self.__base_url = base_url

self.__auth_lock = RLock()

if password is not None:
login = login_or_token
b64 = (
Expand Down Expand Up @@ -388,10 +385,9 @@ def _refresh_token_if_needed(self) -> None:
"""Get a new access token from the GitHub app installation if the one we have is about to expire"""
if not self.__installation_authorization:
return
with self.__auth_lock:
if self._must_refresh_token():
logging.debug("Refreshing access token")
self._refresh_token()
if self._must_refresh_token():
logging.debug("Refreshing access token")
self._refresh_token()

def _refresh_token(self) -> None:
"""In the context of a GitHub app, refresh the access token"""
Expand Down