feat: fix

This commit is contained in:
2025-04-09 15:50:45 +03:00
parent 2a8833d7a9
commit 2730ced37e
2 changed files with 3 additions and 2 deletions

View File

@@ -14,4 +14,4 @@ async def init_producer():
bootstrap_servers=KAFKA_URL, bootstrap_servers=KAFKA_URL,
security_protocol='SSL', security_protocol='SSL',
ssl_context=context, ssl_context=context,
) )

View File

@@ -21,7 +21,8 @@ origins = [
async def lifespan(app: FastAPI): async def lifespan(app: FastAPI):
try: try:
await init_producer() await init_producer()
await producer.start() if producer:
await producer.start()
except KafkaConnectionError as e: except KafkaConnectionError as e:
print(e) print(e)