Added watchdog support
This commit is contained in:
21
constants.py
21
constants.py
@@ -33,8 +33,20 @@ PROG_VERSION = "0.9.15-dev"
|
||||
PROG_AUTHOR = "Ignacio Serantes"
|
||||
|
||||
# --- CACHE SETTINGS ---
|
||||
# Maximum number of thumbnails to keep in the in-memory cache.
|
||||
CACHE_MAX_SIZE = 20000
|
||||
# Maximum number of paths to track in the in-memory cache.
|
||||
CACHE_MAX_SIZE = 10000
|
||||
|
||||
# Dynamic RAM limit for thumbnails to avoid swapping on low-end systems.
|
||||
try:
|
||||
import psutil
|
||||
_total_ram_bytes = psutil.virtual_memory().total
|
||||
# Use 10% of system RAM, clamped between 128MB and 512MB
|
||||
CACHE_MAX_RAM_BYTES = int(max(128 * 1024 * 1024,
|
||||
min(512 * 1024 * 1024, _total_ram_bytes * 0.10)))
|
||||
except (ImportError, Exception):
|
||||
# Fallback to a safe 256MB if psutil is missing or fails
|
||||
CACHE_MAX_RAM_BYTES = 256 * 1024 * 1024
|
||||
|
||||
# Maximum size of the persistent disk cache file.
|
||||
# 10 GB limit for persistent cache file
|
||||
DISK_CACHE_MAX_BYTES = 10 * 1024 * 1024 * 1024
|
||||
@@ -814,6 +826,7 @@ _UI_TEXTS = {
|
||||
"ERROR_MOVE_FILE": "Could not move file: {}",
|
||||
"ERROR_COPY_FILE": "Could not copy file: {}",
|
||||
"MOVED_TO": "Moved to {}",
|
||||
"FS_WATCHER_TOOLTIP": "File System Watcher (monitoring active directories)",
|
||||
"COPIED_TO": "Copied to {}",
|
||||
"ERROR_ROTATE_IMAGE": "Could not rotate image: {}",
|
||||
},
|
||||
@@ -1285,6 +1298,8 @@ _UI_TEXTS = {
|
||||
"ERROR_MOVE_FILE": "No se pudo mover el archivo: {}",
|
||||
"ERROR_COPY_FILE": "No se pudo copiar el archivo: {}",
|
||||
"MOVED_TO": "Movido a {}",
|
||||
"FS_WATCHER_TOOLTIP": "Monitor de Sistema de Archivos (monitoreando "
|
||||
"directorios activos)",
|
||||
"COPIED_TO": "Copiado a {}",
|
||||
"ERROR_ROTATE_IMAGE": "No se pudo girar la imagen: {}",
|
||||
},
|
||||
@@ -1757,6 +1772,8 @@ _UI_TEXTS = {
|
||||
"ERROR_MOVE_FILE": "Non se puido mover o ficheiro: {}",
|
||||
"ERROR_COPY_FILE": "Non se puido copiar o ficheiro: {}",
|
||||
"MOVED_TO": "Movido a {}",
|
||||
"FS_WATCHER_TOOLTIP": "Monitor do Sistema de Ficheiros (monitoreando "
|
||||
"directorios activos)",
|
||||
"COPIED_TO": "Copiado a {}",
|
||||
"ERROR_ROTATE_IMAGE": "Non se puido xirar a imaxe: {}",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user