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 08f0485
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/utils/jira.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 08f0485

Please sign in to comment.