diff --git a/worldbuild-worker.py b/worldbuild-worker.py index e6b9264..f032d96 100755 --- a/worldbuild-worker.py +++ b/worldbuild-worker.py @@ -92,6 +92,7 @@ def get_job(action): sock.connect((host, port)) sock.send(("get " + action).encode()) msg = sock.recv(128) + sock.close() msg = msg.decode() match = re.match(r"n-pole|s-pole|[ew]\d{3}[ns]\d{2}|None", msg) if match != None: @@ -103,7 +104,6 @@ def get_job(action): print("Recived invalid job. Retrying in 10 seconds...") sleep(10) ret = get_job(action) - sock.close() return ret except IOError: print("Unable to get job. Retrying in 10 seconds...")