Skip to content

Commit

Permalink
GRLE previews update and queue changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Dec 10, 2024
1 parent 49eebd8 commit c4909ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion maps4fs/generator/grle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions webui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions webui/queuing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,))
Expand All @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit c4909ee

Please sign in to comment.