From c4909eed72013ddfe60a399b9086a5cac968e285 Mon Sep 17 00:00:00 2001 From: Stan Soldatov Date: Tue, 10 Dec 2024 02:42:43 +0100 Subject: [PATCH] GRLE previews update and queue changes. --- maps4fs/generator/grle.py | 2 +- webui/config.py | 4 ++-- webui/queuing.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/maps4fs/generator/grle.py b/maps4fs/generator/grle.py index 185bf4e8..f3dcc043 100644 --- a/maps4fs/generator/grle.py +++ b/maps4fs/generator/grle.py @@ -58,7 +58,7 @@ def process(self) -> None: data_type = info_layer["data_type"] self.logger.debug( - "Creating InfoLayer PNG file %s with dimensions %dx%d, %d channels, " + "Creating InfoLayer PNG file %s with dimensions %sx%s, %s channels, " "and data type %s.", file_path, height, diff --git a/webui/config.py b/webui/config.py index a4243c8d..e6ca36ae 100644 --- a/webui/config.py +++ b/webui/config.py @@ -24,7 +24,7 @@ FAQ_MD = os.path.join(DOCS_DIRECTORY, "FAQ.md") QUEUE_FILE = os.path.join(WORKING_DIRECTORY, "queue.json") -QUEUE_TIMEOUT = 120 # 2 minutes +QUEUE_TIMEOUT = 180 # 3 minutes QUEUE_INTERVAL = 10 REMOVE_DELAY = 300 # 5 minutes @@ -64,7 +64,7 @@ def remove_with_delay_without_blocking( """ def remove_file() -> None: - logger.info("Removing file from %s in %d seconds.", file_path, delay) + logger.info("Removing file from %s in %s seconds.", file_path, delay) sleep(delay) try: os.remove(file_path) diff --git a/webui/queuing.py b/webui/queuing.py index 8a91ac0e..c6e4491d 100644 --- a/webui/queuing.py +++ b/webui/queuing.py @@ -102,7 +102,7 @@ def wait_in_queue(session: str) -> Generator[int, None, None]: """ retries = QUEUE_TIMEOUT // QUEUE_INTERVAL logger.debug( - "Starting to wait in the queue for session %s with maximum retries %d.", session, retries + "Starting to wait in the queue for session %s with maximum retries %s.", session, retries ) termiation_thread = threading.Thread(target=start_termination, args=(session,)) @@ -113,7 +113,7 @@ def wait_in_queue(session: str) -> Generator[int, None, None]: if position == 0 or position is None: logger.debug("Session %s is the first item in the queue.", session) return - logger.debug("Session %s is in position %d in the queue.", session, position) + logger.debug("Session %s is in position %s in the queue.", session, position) yield position sleep(QUEUE_INTERVAL) @@ -126,7 +126,7 @@ def start_termination(session: str) -> None: Arguments: session (str): The session to terminate. """ - logger.debug("Session %s will be terminated after %d seconds.", session, QUEUE_TIMEOUT) + logger.debug("Session %s will be terminated after %s seconds.", session, QUEUE_TIMEOUT) sleep(QUEUE_TIMEOUT) remove_from_queue(session)