From 7dc412fcf1932e7f6d53ec83609a95afcbd65643 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Wed, 19 Jun 2024 21:24:01 +0200 Subject: [PATCH] Refactor encoding method and reduce sleep time The decoding method in the manage_athenad file has been refactored for parameter retrieval. Instead of decoding after receiving the parameter, decoding is now integrated in the parameter retrieval process. Also, the waiting time in the sunnylinkd.py has been reduced from 60 seconds to 10 to enhance performance and reduce lag. --- system/athena/manage_athenad.py | 2 +- system/athena/sunnylinkd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/athena/manage_athenad.py b/system/athena/manage_athenad.py index fb514bc1ca..7158cd9220 100755 --- a/system/athena/manage_athenad.py +++ b/system/athena/manage_athenad.py @@ -18,7 +18,7 @@ def main(): def manage_athenad(dongle_id_param, pid_param, process_name, target): params = Params() - dongle_id = params.get(dongle_id_param).decode('utf-8') + dongle_id = params.get(dongle_id_param, encoding='utf-8') build_metadata = get_build_metadata() cloudlog.bind_global(dongle_id=dongle_id, diff --git a/system/athena/sunnylinkd.py b/system/athena/sunnylinkd.py index f999f1eb2f..2f19983198 100755 --- a/system/athena/sunnylinkd.py +++ b/system/athena/sunnylinkd.py @@ -193,7 +193,7 @@ def main(exit_event: threading.Event = None): is_registered = params.get("SunnylinkDongleId", encoding='utf-8') not in (None, UNREGISTERED_SUNNYLINK_DONGLE_ID) while params.get_bool("SunnylinkEnabled") and not is_registered: cloudlog.info("Waiting for sunnylink registration to complete") - time.sleep(60) + time.sleep(10) UploadQueueCache.initialize(upload_queue)