Spaces:
Sleeping
Sleeping
Commit ·
4203c70
1
Parent(s): 8976c40
proxy pool race condition fixed
Browse files- freeplay2api.py +5 -0
freeplay2api.py
CHANGED
|
@@ -235,6 +235,11 @@ class FreeplayClient:
|
|
| 235 |
except Exception as e:
|
| 236 |
logging.error(f"An unexpected error occurred during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 237 |
logging.info(f"CONTINUING AFTER UNEXPECTED ERROR TO ATTEMPT {attempt + 1}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
logging.error("Failed to register a new account after 50 attempts.")
|
| 240 |
logging.info("REGISTER FUNCTION ENDING")
|
|
|
|
| 235 |
except Exception as e:
|
| 236 |
logging.error(f"An unexpected error occurred during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 237 |
logging.info(f"CONTINUING AFTER UNEXPECTED ERROR TO ATTEMPT {attempt + 1}")
|
| 238 |
+
|
| 239 |
+
# Wait 2 seconds between attempts to give proxy pool time to refill
|
| 240 |
+
if attempt < 50:
|
| 241 |
+
logging.info(f"Waiting 2 seconds before attempt {attempt + 1}...")
|
| 242 |
+
time.sleep(2)
|
| 243 |
|
| 244 |
logging.error("Failed to register a new account after 50 attempts.")
|
| 245 |
logging.info("REGISTER FUNCTION ENDING")
|