Asyncio lock not working when fetching data from API asynchronously
My function below is not working as intended. It is an async function, and I want it so that when the response is a 401 and the lock is not locked, it removes the first value in api_keys
. When the lock is locked, I want it to retry, as api_keys
is currently being modified. However, the output prints multiple status code 401s in a row, but my code should change the current api key when a 401 is returned and should work from there.