mirror of
https://github.com/HuFlungDu/pylibmeshctrl.git
synced 2026-02-20 13:42:11 +00:00
Added timeout to check_socket decorator in case a connection fails to be made
This commit is contained in:
@@ -139,7 +139,7 @@ def compare_dict(dict1, dict2):
|
||||
def _check_socket(f):
|
||||
@functools.wraps(f)
|
||||
async def wrapper(self, *args, **kwargs):
|
||||
await self.initialized.wait()
|
||||
await asyncio.wait_for(self.initialized.wait(), 10)
|
||||
if not self.alive and self._main_loop_error is not None:
|
||||
raise self._main_loop_error
|
||||
elif not self.alive:
|
||||
@@ -153,3 +153,6 @@ def _process_websocket_exception(exc):
|
||||
if isinstance(exc, (ssl.SSLCertVerificationError, TimeoutError)):
|
||||
return exc
|
||||
return tmp
|
||||
|
||||
class Proxy(object):
|
||||
pass
|
||||
Reference in New Issue
Block a user