mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
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:
parent
d709c6bd60
commit
c8759ac872
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user