|
|
@@ -97,16 +97,18 @@ class PManager:
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
|
|
|
- def conn(self, target):
|
|
|
+ def conn(self, target, timeout=None):
|
|
|
if self.ws is None:
|
|
|
self.ws = websocket.WebSocket()
|
|
|
try:
|
|
|
self.ws.connect(target)
|
|
|
except Exception as e:
|
|
|
log(e)
|
|
|
- time.sleep(2)
|
|
|
- self.conn(target) #keep trying you basterd
|
|
|
-
|
|
|
+ if timeout is None:
|
|
|
+ timeout = 2
|
|
|
+ timeout = min(timeout, 90)
|
|
|
+ time.sleep(timeout)
|
|
|
+ self.conn(target, timeout+2) #keep trying you basterd
|
|
|
|
|
|
def close(self):
|
|
|
if self.ws is None:
|