Added serverdownload to thread.

Removed exit command if server jar doesn't exist. This was causing exit.txt to constantly try to stop crafty after a jar download in the thread.
This commit is contained in:
Andrew 2021-08-21 14:25:39 -04:00
parent d709c6bd60
commit c8759ac872
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import os
import sys
import json
import threading
import time
import shutil
import logging
@ -173,6 +174,10 @@ class ServerJars:
return response
def download_jar(self, server, version, path):
update_thread = threading.Thread(target=self.a_download_jar, daemon=True, name="exe_download", args=(server, version, path))
update_thread.start()
def a_download_jar(self, server, version, path):
fetch_url = "{base}/api/fetchJar/{server}/{version}".format(base=self.base_url, server=server, version=version)
# open a file stream

View File

@ -149,7 +149,6 @@ class Server:
if not helper.check_file_exists(full_path):
logger.critical("Server executable path: {} does not seem to exist".format(full_path))
console.critical("Server executable path: {} does not seem to exist".format(full_path))
helper.do_exit()
if not helper.check_path_exists(self.server_path):
logger.critical("Server path: {} does not seem to exits".format(self.server_path))