Made sure that port 9090 could not be randomly selected.
This commit is contained in:
parent
e40e190e1e
commit
e79cf82b62
@ -30,7 +30,7 @@ class Server:
|
||||
@property
|
||||
def port(self):
|
||||
"""Get the port of the server."""
|
||||
port = 9090
|
||||
port = "9090"
|
||||
if "MTT_PORT" in self.env:
|
||||
port = self.env["MTT_PORT"]
|
||||
return port
|
||||
@ -68,6 +68,7 @@ class Server:
|
||||
|
||||
def set_safe_port(self):
|
||||
"""Set the server port to something not being used."""
|
||||
while self.port == "9090":
|
||||
sock = socket()
|
||||
sock.bind((self.address, 0))
|
||||
self.port = sock.getsockname()[1]
|
||||
|
Loading…
Reference in New Issue
Block a user