feat: fix

This commit is contained in:
2025-04-09 15:47:21 +03:00
parent 00c112b20d
commit ba2a95f22e

View File

@@ -1,10 +1,17 @@
from typing import Optional
from aiokafka import AIOKafkaProducer
from backend.config import KAFKA_URL
from external.kafka.context import context
producer = AIOKafkaProducer(
bootstrap_servers=KAFKA_URL,
security_protocol='SSL',
ssl_context=context,
)
producer: Optional[AIOKafkaProducer] = None
async def init_producer():
global producer
producer = AIOKafkaProducer(
bootstrap_servers=KAFKA_URL,
security_protocol='SSL',
ssl_context=context,
)