Skip to content

Commit

Permalink
Make caching optional, default to false
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Oct 25, 2024
1 parent 95f6b43 commit edc5f08
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/utils/jira.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
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(
Expand Down

0 comments on commit edc5f08

Please sign in to comment.