Skip to content

Commit

Permalink
Tune Down GHAPI Cache TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
kamoo1 committed May 21, 2023
1 parent 2638bb5 commit f6e85bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ah/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def __init__(self, cache: Cache, gh_proxy=None) -> None:
self.session.mount("http://", HTTPAdapter(max_retries=retries))
super().__init__(cache=cache)

@bound_cache(SECONDS_IN.HOUR)
@bound_cache(10 * SECONDS_IN.MIN)
def get_assets_uri(self, owner: str, repo: str) -> Dict[str, str]:
url = "https://api.github.com/repos/{user}/{repo}/releases/latest"
if self.gh_proxy:
Expand Down Expand Up @@ -236,7 +236,7 @@ def get_assets_uri(self, owner: str, repo: str) -> Dict[str, str]:

return ret

@bound_cache(SECONDS_IN.HOUR)
@bound_cache(10 * SECONDS_IN.MIN)
def get_asset(self, url: str) -> bytes:
if self.gh_proxy:
url = self.gh_proxy + url
Expand Down

0 comments on commit f6e85bc

Please sign in to comment.