Skip to content

Commit

Permalink
Remove RLock from Requester (#2446)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Mar 14, 2023
1 parent e414c32 commit 45f3d72
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions github/Requester.py
Original file line number Diff line number Diff line change
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

0 comments on commit 45f3d72

Please sign in to comment.