Skip to content

Commit

Permalink
import when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kumar-saini committed Oct 4, 2023
1 parent 4bd1d42 commit 4105d72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sentry/cogs/accountant.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from django.conf import settings
from usageaccountant import UsageAccumulator, UsageUnit

from sentry.utils.kafka_config import get_kafka_producer_cluster_options, get_topic_definition

logger = logging.getLogger("usageaccountant")


Expand All @@ -17,6 +15,11 @@
def _accumulator(create: bool = False) -> UsageAccumulator | None:
global accumulator
if accumulator is None and create:
from sentry.utils.kafka_config import (
get_kafka_producer_cluster_options,
get_topic_definition,
)

producer = KafkaProducer(
build_kafka_configuration(
get_kafka_producer_cluster_options(
Expand Down

0 comments on commit 4105d72

Please sign in to comment.