From 08f0485f8d2eb2a9b034d00314dd1a41fe13b63f Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 25 Oct 2024 16:24:47 -0400 Subject: [PATCH] Make caching optional, default to false --- src/utils/jira.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/utils/jira.py b/src/utils/jira.py index fc9d393..fb28aeb 100644 --- a/src/utils/jira.py +++ b/src/utils/jira.py @@ -1,11 +1,19 @@ +import os + import dogpile.cache import jira -cache = dogpile.cache.make_region().configure( - "dogpile.cache.dbm", - expiration_time=7200, - arguments={"filename": "jira.cache"}, -) +if os.environ.get("PRIORITIZE_CACHE"): + cache_args = ("dogpile.cache.dbm",) + cache_kwargs = dict( + expiration_time=7200, + arguments={"filename": "jira.cache"}, + ) +else: + cache_args = ("dogpile.cache.null",) + cache_kwargs = {} + +cache = dogpile.cache.make_region().configure(*cache_args, **cache_kwargs) def get_issues(