Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 1b73d67

Browse files
committed
Use the cache instance directly from shared
Instead of creating a cache instance within a `worker` module, use an initialized `cache` instance from `shared` instead.
1 parent ad52223 commit 1b73d67

9 files changed

Lines changed: 9 additions & 15 deletions

File tree

celery_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
health_check_task_name,
1616
)
1717
from shared.config import get_config
18-
from shared.helpers.cache import RedisBackend
18+
from shared.helpers.cache import RedisBackend, cache
1919

2020
from celery_task_router import route_task
21-
from helpers.cache import cache
2221
from helpers.clock import get_utc_now_as_iso_format
2322
from helpers.health_check import get_health_check_interval_seconds
2423
from services.redis import get_redis_connection

helpers/cache.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ dev-dependencies = [
8383
[tool.uv.sources]
8484
timestring = { git = "https://github.com/codecov/timestring", rev = "d37ceacc5954dff3b5bd2f887936a98a668dda42" }
8585
test-results-parser = { git = "https://github.com/codecov/test-results-parser", rev = "190bbc8a911099749928e13d5fe57f6027ca1e74" }
86-
shared = { git = "https://github.com/codecov/shared", rev = "8acbdc67b66c371cbcdfbbfef5296692899a42e5" }
86+
shared = { git = "https://github.com/codecov/shared", rev = "470269642d3d843c969dbb07edc38d6b541f2628" }

services/bundle_analysis/notify/messages/commit_status.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
import sentry_sdk
55
from asgiref.sync import async_to_sync
66
from django.template import loader
7-
from shared.helpers.cache import make_hash_sha256
7+
from shared.helpers.cache import cache, make_hash_sha256
88
from shared.torngit.exceptions import TorngitClientError
99

10-
from helpers.cache import cache
1110
from services.bundle_analysis.notify.contexts.commit_status import (
1211
CommitStatusLevel,
1312
CommitStatusNotificationContext,

services/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from redis import RedisError
55
from shared.github import InvalidInstallationError
66
from shared.github import get_github_integration_token as _get_github_integration_token
7+
from shared.helpers.cache import cache
78

89
from database.models.core import Commit
9-
from helpers.cache import cache
1010
from helpers.exceptions import RepositoryWithoutValidBotError
1111
from services.redis import get_redis_connection
1212

services/notification/notifiers/status/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
import sentry_sdk
55
from asgiref.sync import async_to_sync
66
from shared.config import get_config
7-
from shared.helpers.cache import NO_VALUE, make_hash_sha256
7+
from shared.helpers.cache import NO_VALUE, cache, make_hash_sha256
88
from shared.torngit.exceptions import TorngitClientError, TorngitError
99

10-
from helpers.cache import cache
1110
from helpers.match import match
1211
from services.comparison import ComparisonProxy, FilteredComparison
1312
from services.notification.notifiers.base import (

services/yaml/fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import logging
22

33
import shared.torngit as torngit
4+
from shared.helpers.cache import cache
45
from shared.yaml import (
56
fetch_current_yaml_from_provider_via_reference as shared_fetch_current_yaml_from_provider_via_reference,
67
)
78

89
from database.models import Commit
9-
from helpers.cache import cache
1010
from services.yaml.parser import parse_yaml_file
1111

1212
log = logging.getLogger(__name__)

tasks/upload_finisher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
timeseries_save_commit_measurements_task_name,
1616
upload_finisher_task_name,
1717
)
18+
from shared.helpers.cache import cache
1819
from shared.reports.resources import Report
1920
from shared.timeseries.helpers import is_timeseries_enabled
2021
from shared.torngit.exceptions import TorngitError
@@ -25,7 +26,6 @@
2526
from database.enums import CommitErrorTypes
2627
from database.models import Commit, Pull
2728
from database.models.core import GITHUB_APP_INSTALLATION_DEFAULT_NAME
28-
from helpers.cache import cache
2929
from helpers.checkpoint_logger.flows import UploadFlow
3030
from helpers.exceptions import RepositoryWithoutValidBotError
3131
from helpers.github_installation import get_installation_name_for_owner_for_task

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)