From 43d4c079c378a331e693d5791edd4c74653f717e Mon Sep 17 00:00:00 2001 From: "crashkeys.dev" Date: Thu, 1 Jan 2026 15:43:46 +0100 Subject: [PATCH] script: minor change to quickly add a finite list of files to queue. --- redis_random_push.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redis_random_push.py b/redis_random_push.py index 4eff57e..b591dc0 100644 --- a/redis_random_push.py +++ b/redis_random_push.py @@ -14,10 +14,11 @@ from pathlib import Path import redis import typer -def main(source_key, destination_key, rename_key: bool = False, password: str = "", host: str = "localhost", port: int = 16379, quotes_pattern: str = "quotes/**/*.txt", log_level: str = "INFO") -> None: +def main(source_key, destination_key, rename_key: bool = False, password: str = "", host: str = "localhost", port: int = 16379, quotes_pattern: str = "quotes/**/*.txt", quotes_list_file: Path | None = None, log_level: str = "INFO") -> None: logging.getLogger().setLevel(os.getenv("LOGGING") or log_level) - new_quotes = tuple(iglob(quotes_pattern, recursive=True)) + new_quotes = tuple(iglob(quotes_pattern, recursive=True)) if not quotes_list_file else tuple(line for line in quotes_list_file.read_text().split("\n") if line) + logging.info("Quotes to add: `%s`", new_quotes) r = redis.Redis(host=host, port=port, decode_responses=True, password=password) logging.info("Fetching existing list at key `%s`.", source_key) -- 2.51.2