mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] New launching flags test
This commit is contained in:
parent
66d6483f46
commit
98c97964cc
@ -74,7 +74,6 @@ def fetch_logs(user: UserRecord, name: str) -> tuple[HTTPStatus, Union[str, None
|
|||||||
try:
|
try:
|
||||||
with open(log_file, "r") as f:
|
with open(log_file, "r") as f:
|
||||||
logs = f.readlines()[-lines_to_read:]
|
logs = f.readlines()[-lines_to_read:]
|
||||||
text_logs = f.read()
|
|
||||||
return HTTPStatus.OK, str(logs)
|
return HTTPStatus.OK, str(logs)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return HTTPStatus.NOT_FOUND, "Log file not found."
|
return HTTPStatus.NOT_FOUND, "Log file not found."
|
||||||
|
@ -21,7 +21,16 @@ class MinecraftServerManager:
|
|||||||
if port in self.servers:
|
if port in self.servers:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
command = f"{java_executable} -Xmx{memory_size} -Xms{memory_size} -jar {jar_file} --nogui > /dev/null"
|
reg_flags: str = ("-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200"
|
||||||
|
" -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch"
|
||||||
|
" -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M"
|
||||||
|
" -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4"
|
||||||
|
" -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90"
|
||||||
|
" -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem"
|
||||||
|
" -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true"
|
||||||
|
" -Dusing.aikars.flags=https://mcutils.com")
|
||||||
|
|
||||||
|
command = f"{java_executable} -Xmx{memory_size} {reg_flags} -jar {jar_file} --nogui"
|
||||||
process = subprocess.Popen(shlex.split(command), cwd=server_directory, stdin=subprocess.PIPE)
|
process = subprocess.Popen(shlex.split(command), cwd=server_directory, stdin=subprocess.PIPE)
|
||||||
|
|
||||||
self.servers_count = len(self.servers) + 1
|
self.servers_count = len(self.servers) + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user