mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
- add a configurable ROMM_TMP_PATH environment variable for controlling where large file operations take place like 7z extraction
This commit is contained in:
@@ -22,6 +22,7 @@ DEV_SQL_ECHO: Final = str_to_bool(os.environ.get("DEV_SQL_ECHO", "false"))
|
||||
|
||||
# PATHS
|
||||
ROMM_BASE_PATH: Final = os.environ.get("ROMM_BASE_PATH", "/romm")
|
||||
ROMM_TMP_PATH: Final = os.environ.get("ROMM_TMP_PATH", None)
|
||||
LIBRARY_BASE_PATH: Final = f"{ROMM_BASE_PATH}/library"
|
||||
RESOURCES_BASE_PATH: Final = f"{ROMM_BASE_PATH}/resources"
|
||||
ASSETS_BASE_PATH: Final = f"{ROMM_BASE_PATH}/assets"
|
||||
|
||||
@@ -7,6 +7,10 @@ from pathlib import Path
|
||||
|
||||
from logger.logger import log
|
||||
|
||||
from config import (
|
||||
ROMM_TMP_PATH,
|
||||
)
|
||||
|
||||
SEVEN_ZIP_PATH = "/usr/bin/7zz"
|
||||
FILE_READ_CHUNK_SIZE = 1024 * 8
|
||||
|
||||
@@ -60,7 +64,7 @@ def process_file_7z(
|
||||
if not largest_file:
|
||||
return False
|
||||
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
with tempfile.TemporaryDirectory(dir = ROMM_TMP_PATH) as temp_dir:
|
||||
log.debug(f"Extracting {largest_file} from {file_path}...")
|
||||
|
||||
temp_path = Path(temp_dir)
|
||||
|
||||
Reference in New Issue
Block a user