Agent: Add try/except block in _calculate_timeout in MonkeyTunnel
This commit is contained in:
parent
c9b9a27c34
commit
2e087cf521
|
@ -200,8 +200,11 @@ class MonkeyTunnel(Thread):
|
|||
proxy.stop()
|
||||
proxy.join()
|
||||
|
||||
def _calculate_timeout(self):
|
||||
return QUIT_TIMEOUT - (time.time() - get_last_serve_time())
|
||||
def _calculate_timeout(self) -> float:
|
||||
try:
|
||||
return QUIT_TIMEOUT - (time.time() - get_last_serve_time())
|
||||
except TypeError: # get_last_serve_time() may return None
|
||||
return 0.0
|
||||
|
||||
def get_tunnel_for_ip(self, ip: str):
|
||||
|
||||
|
|
Loading…
Reference in New Issue