From 7e705338b902292682eee426a49ca596bf12633d Mon Sep 17 00:00:00 2001 From: I-am-PUID-0 <36779668+I-am-PUID-0@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:37:00 -0400 Subject: [PATCH] Version [5.4.3] --- CHANGELOG.md | 8 ++++++++ main.py | 2 +- riven_/settings.py | 2 +- riven_/setup.py | 17 +++++++++++------ utils/processes.py | 1 + 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b6bd37..1298499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## Version [5.4.3] - 2024-11-01 🚀 + +### Changed 🔄 + +- Riven Frontend: Updated the name and location of the `server-config.json` file to `server.json` and to be transferred to the /riven/frontend/config directory on startup 🔄 +- Re-enabled reaping of zombie processes 🔄 + + ## Version [5.4.2] - 2024-10-29 🚀 ### Fixed 🛠️ diff --git a/main.py b/main.py index 651b240..7546d24 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,7 @@ def main(): - version = "5.4.2" + version = "5.4.3" ascii_art = f""" diff --git a/riven_/settings.py b/riven_/settings.py index af86171..6cf49d5 100644 --- a/riven_/settings.py +++ b/riven_/settings.py @@ -25,7 +25,7 @@ def save_server_config(backend_url, api_key, config_dir="/config"): os.makedirs(config_dir, exist_ok=True) - config_file_path = os.path.join(config_dir, "server-config.json") + config_file_path = os.path.join(config_dir, "server.json") try: with open(config_file_path, "w") as config_file: diff --git a/riven_/setup.py b/riven_/setup.py index f799ea1..6f58433 100644 --- a/riven_/setup.py +++ b/riven_/setup.py @@ -146,26 +146,31 @@ def clear_directory(directory_path, exclude_dirs=None): def copy_server_config_to_frontend(): - source_config_path = "/config/server-config.json" - destination_config_path = "/riven/frontend/server-config.json" + source_config_path = "/config/server.json" + destination_dir = "/riven/frontend/config" + destination_config_path = os.path.join(destination_dir, "server.json") try: if not os.path.exists(source_config_path): logger.debug( - f"server-config.json not found at {source_config_path}, skipping copy." + f"server.json not found at {source_config_path}, skipping copy." ) return + if not os.path.exists(destination_dir): + os.makedirs(destination_dir) + logger.debug(f"Created directory {destination_dir} for server.json") + if os.path.exists(destination_config_path): logger.debug( - f"Overwriting existing server-config.json at {destination_config_path}" + f"Overwriting existing server.json at {destination_config_path}" ) shutil.copy2(source_config_path, destination_config_path) - logger.debug(f"Copied server-config.json to {destination_config_path}") + logger.debug(f"Copied server.json to {destination_config_path}") except Exception as e: - logger.error(f"Failed to copy server-config.json: {e}") + logger.error(f"Failed to copy server.json: {e}") def riven_setup( diff --git a/utils/processes.py b/utils/processes.py index e781350..c3dbfee 100644 --- a/utils/processes.py +++ b/utils/processes.py @@ -13,6 +13,7 @@ def __new__(cls, *args, **kwargs): cls._instance.init_attributes(*args, **kwargs) signal.signal(signal.SIGTERM, cls._instance.shutdown) signal.signal(signal.SIGINT, cls._instance.shutdown) + signal.signal(signal.SIGCHLD, cls._instance.reap_zombies) return cls._instance def init_attributes(self, logger):