diff --git a/.gitlab/windows-build.yml b/.gitlab/windows-build.yml index dd8dc796..2dd6fb50 100644 --- a/.gitlab/windows-build.yml +++ b/.gitlab/windows-build.yml @@ -30,6 +30,11 @@ win-dev-build: --collect-all tzdata --collect-all pytz --collect-all six + - | + echo "Retrieving 'latest' updater from crafty-controller/crafty-4-windows-updater" + $src = 'https://gitlab.com/crafty-controller/crafty-4-windows-updater/-/jobs/artifacts/dev/raw/crafty_updater.exe?job=win-dev-build' + $dest = 'crafty_updater.exe' + Invoke-WebRequest -Uri $src -OutFile $dest # Download latest: # | https://gitlab.com/crafty-controller/crafty-4/-/jobs/artifacts/dev/download?job=win-dev-build @@ -38,6 +43,7 @@ win-dev-build: paths: - app\ - .\crafty.exe + - .\crafty_updater.exe exclude: - app\classes\**\* @@ -72,6 +78,11 @@ win-prod-build: --collect-all tzdata --collect-all pytz --collect-all six + - | + echo "Retrieving 'latest' updater from crafty-controller/crafty-4-windows-updater" + $src = 'https://gitlab.com/crafty-controller/crafty-4-windows-updater/-/jobs/artifacts/master/raw/crafty_updater.exe?job=win-prod-build' + $dest = 'crafty_updater.exe' + Invoke-WebRequest -Uri $src -OutFile $dest after_script: - Add-Content -Path job.env -Value "JOB_ID=$CI_JOB_ID" @@ -82,6 +93,7 @@ win-prod-build: paths: - app\ - .\crafty.exe + - .\crafty_updater.exe expire_in: never exclude: - app\classes\**\* diff --git a/CHANGELOG.md b/CHANGELOG.md index c295a456..2dc69fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## --- [4.0.12] - 2022/TBD +## --- [4.0.12] - 2022/09/04 ### New features -TBD +- Win Portable Updater will now be included in Windows Package ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/446)) ### Bug fixes -TBD +- Fix performance issues on server metrics panels (Temporarily setting to 24hr query) ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/440)) +- Fix no id on import3 servers ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/442)) ### Tweaks TBD ### Lang diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index a0948769..c9434b13 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -106,11 +106,9 @@ class ServersController(metaclass=Singleton): return ret def get_history_stats(self, server_id): - max_age = self.helper.get_setting("history_max_age") now = datetime.datetime.now() - minimum_to_exist = now - datetime.timedelta(days=max_age) srv = ServersController().get_server_instance_by_id(server_id) - return srv.stats_helper.get_history_stats(server_id, minimum_to_exist) + return srv.stats_helper.get_history_stats(server_id) @staticmethod def update_unloaded_server(server_obj): diff --git a/app/classes/models/server_stats.py b/app/classes/models/server_stats.py index 6e589ffc..d6c6efdc 100644 --- a/app/classes/models/server_stats.py +++ b/app/classes/models/server_stats.py @@ -1,6 +1,7 @@ import os import logging import datetime +from datetime import timedelta from app.classes.models.servers import Servers, HelperServers from app.classes.shared.helpers import Helpers @@ -137,7 +138,8 @@ class HelperServerStats: ) return server_data - def get_history_stats(self, server_id, max_age): + def get_history_stats(self, server_id): + max_age = datetime.datetime.now() - timedelta(days=1) return ( ServerStats.select() .where(ServerStats.created > max_age) diff --git a/app/classes/shared/import3.py b/app/classes/shared/import3.py index 5cb2bfa6..4da9bcb8 100644 --- a/app/classes/shared/import3.py +++ b/app/classes/shared/import3.py @@ -74,6 +74,7 @@ class Import3: min_mem=(int(server["memory_min"]) / 1000), max_mem=(int(server["memory_max"]) / 1000), port=server["server_port"], + user_id=HelperUsers.get_user_id_by_name("system"), ) Console.info( f"Imported server {server['server_name']}[{server['id']}] " @@ -91,6 +92,7 @@ class Import3: min_mem=(int(json_data["memory_min"]) / 1000), max_mem=(int(json_data["memory_max"]) / 1000), port=json_data["server_port"], + user_id=HelperUsers.get_user_id_by_name("system"), ) Console.info( f"Imported server {json_data['server_name']}[{json_data['id']}] "