Skip to content

Commit 5b01fd6

Browse files
committed
ref(github): Use django cache instead of sentry default_cache
getsentry configures CACHES with memcached in production, so django.core.cache.cache works and matches the pattern used by the rest of the integrations codebase.
1 parent c0987be commit 5b01fd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sentry/integrations/github/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import orjson
1010
import sentry_sdk
11+
from django.core.cache import cache
1112
from requests import PreparedRequest
1213

13-
from sentry.cache import default_cache
1414
from sentry.constants import ObjectStatus
1515
from sentry.integrations.github.blame import (
1616
create_blame_query,
@@ -570,13 +570,13 @@ def get_accessible_repos_cached(self, ttl: int = 300) -> list[CachedRepo]:
570570
the cache payload small.
571571
"""
572572
cache_key = f"github:accessible_repos:{self.integration.id}"
573-
cached = default_cache.get(cache_key)
573+
cached = cache.get(cache_key)
574574
if cached is not None:
575575
return cached
576576

577577
all_repos = self.get_repos()
578578
repos = [{k: r.get(k) for k in self._CACHED_REPO_FIELDS} for r in all_repos]
579-
default_cache.set(cache_key, repos, ttl)
579+
cache.set(cache_key, repos, ttl)
580580
return repos
581581

582582
def search_repositories(self, query: bytes) -> Mapping[str, Sequence[Any]]:

0 commit comments

Comments
 (0)