Teekeks / pyTwitchAPI

A Python 3.7 compatible implementation of the Twitch API, EventSub, PubSub and Chat
https://pytwitchapi.dev
MIT License
254 stars 38 forks source link

Add lock to auth refresh to avoid race condition #184

Closed Teekeks closed 1 year ago

Teekeks commented 1 year ago

Now that the library is async, there is a possibility for a race condition when trying to refresh a oauth token. A lock would resolve this issue and it would not be a performance hit since the calls have to wait anyway till the token refresh is complete.