Thread safety issues when sharing OauthClient in Celery workers
Description
Using a shared OauthClient across Celery workers leads to inconsistent results.
Code snippet
from celery import shared_task
from openapi_sdk import OauthClient
oauth_client = OauthClient("user", "apikey", test=True)
@shared_task
def fetch_token():
return oauth_client.create_token(["scope"], 3600)
Observed behavior
Random failures or corrupted responses.