From a30cdc9d0fbd31778d2482dcc521d4d165e82c47 Mon Sep 17 00:00:00 2001 From: Robert David Stein Date: Tue, 20 Aug 2024 13:59:29 -0700 Subject: [PATCH] Fix #948 (#986) --- env.example | 2 +- mirar/data/cache.py | 11 ++++++++++- mirar/data/image_data.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/env.example b/env.example index f8f6445f0..ddad44cd0 100644 --- a/env.example +++ b/env.example @@ -39,4 +39,4 @@ WATCHDOG_EMAIL_RECIPIENTS= # Set maximum number of CPUs to use, with a default of half the available total MAX_N_CPU= # Set whether to store images in cache, with a default of true -USE_WINTER_CACHE= +USE_MIRAR_CACHE= diff --git a/mirar/data/cache.py b/mirar/data/cache.py index 9047626fc..c7ef4a4bf 100644 --- a/mirar/data/cache.py +++ b/mirar/data/cache.py @@ -10,7 +10,16 @@ logger = logging.getLogger(__name__) -USE_CACHE: bool = os.getenv("USE_WINTER_CACHE", "true") in ["true", "True", True] +USE_CACHE: bool = os.getenv("USE_MIRAR_CACHE", "true") in ["true", "True", True] + +if not USE_CACHE: + if os.getenv("USE_WINTER_CACHE") is not None: + logger.warning( + "The environment variable 'USE_WINTER_CACHE' is deprecated. " + "Please use 'USE_MIRAR_CACHE' instead. " + "This will be removed in a future version." + ) + USE_CACHE = os.getenv("USE_WINTER_CACHE") in ["true", "True", True] class CacheError(Exception): diff --git a/mirar/data/image_data.py b/mirar/data/image_data.py index 313860dc1..1efe1b901 100644 --- a/mirar/data/image_data.py +++ b/mirar/data/image_data.py @@ -49,7 +49,7 @@ .. code-block:: bash - export USE_WINTER_CACHE = false + export USE_MIRAR_CACHE = false See :doc:`usage` for more information about selecting cache mode, and setting the output data directory.