feat: fix
This commit is contained in:
2
external/kafka/producer.py
vendored
2
external/kafka/producer.py
vendored
@@ -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,
|
||||||
)
|
)
|
||||||
3
main.py
3
main.py
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user