Spaces:
Sleeping
Sleeping
Commit ·
fe557af
1
Parent(s): 0a8c489
proxy pool race condition fixed
Browse files- freeplay2api.py +6 -0
freeplay2api.py
CHANGED
|
@@ -231,16 +231,22 @@ class FreeplayClient:
|
|
| 231 |
if self.proxy_pool and proxy_info:
|
| 232 |
self.proxy_pool.remove_proxy(proxy_info['ip'], proxy_info['port'])
|
| 233 |
logging.info(f"CONTINUING AFTER PROXY ERROR TO ATTEMPT {attempt + 1}")
|
|
|
|
|
|
|
| 234 |
|
| 235 |
except requests.exceptions.RequestException as e:
|
| 236 |
logging.warning(f"Request exception during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 237 |
if self.proxy_pool and proxy_info:
|
| 238 |
self.proxy_pool.remove_proxy(proxy_info['ip'], proxy_info['port'])
|
| 239 |
logging.info(f"CONTINUING AFTER REQUEST EXCEPTION TO ATTEMPT {attempt + 1}")
|
|
|
|
|
|
|
| 240 |
|
| 241 |
except Exception as e:
|
| 242 |
logging.error(f"An unexpected error occurred during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 243 |
logging.info(f"CONTINUING AFTER UNEXPECTED ERROR TO ATTEMPT {attempt + 1}")
|
|
|
|
|
|
|
| 244 |
|
| 245 |
|
| 246 |
logging.error("Failed to register a new account after 50 attempts.")
|
|
|
|
| 231 |
if self.proxy_pool and proxy_info:
|
| 232 |
self.proxy_pool.remove_proxy(proxy_info['ip'], proxy_info['port'])
|
| 233 |
logging.info(f"CONTINUING AFTER PROXY ERROR TO ATTEMPT {attempt + 1}")
|
| 234 |
+
# Explicitly continue to next iteration
|
| 235 |
+
continue
|
| 236 |
|
| 237 |
except requests.exceptions.RequestException as e:
|
| 238 |
logging.warning(f"Request exception during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 239 |
if self.proxy_pool and proxy_info:
|
| 240 |
self.proxy_pool.remove_proxy(proxy_info['ip'], proxy_info['port'])
|
| 241 |
logging.info(f"CONTINUING AFTER REQUEST EXCEPTION TO ATTEMPT {attempt + 1}")
|
| 242 |
+
# Explicitly continue to next iteration
|
| 243 |
+
continue
|
| 244 |
|
| 245 |
except Exception as e:
|
| 246 |
logging.error(f"An unexpected error occurred during registration on attempt {attempt}/50: {e}. Retrying...")
|
| 247 |
logging.info(f"CONTINUING AFTER UNEXPECTED ERROR TO ATTEMPT {attempt + 1}")
|
| 248 |
+
# Explicitly continue to next iteration
|
| 249 |
+
continue
|
| 250 |
|
| 251 |
|
| 252 |
logging.error("Failed to register a new account after 50 attempts.")
|