fix: main file changes revert
This commit is contained in:
18
main.py
18
main.py
@@ -24,24 +24,24 @@ async def lifespan(app: FastAPI):
|
|||||||
except KafkaConnectionError as e:
|
except KafkaConnectionError as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
# consumer_task = asyncio.create_task(consume_messages())
|
consumer_task = asyncio.create_task(consume_messages())
|
||||||
|
|
||||||
yield
|
yield
|
||||||
producer = await get_producer()
|
producer = await get_producer()
|
||||||
if producer:
|
if producer:
|
||||||
await producer.stop()
|
await producer.stop()
|
||||||
# consumer_task.cancel()
|
consumer_task.cancel()
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI(lifespan=lifespan, separate_input_output_schemas=False, root_path='/api')
|
app = FastAPI(lifespan=lifespan, separate_input_output_schemas=False, root_path='/api')
|
||||||
|
|
||||||
app.add_middleware(
|
# app.add_middleware(
|
||||||
CORSMiddleware,
|
# CORSMiddleware,
|
||||||
allow_origins=["*"],
|
# allow_origins=origins,
|
||||||
allow_credentials=True,
|
# allow_credentials=True,
|
||||||
allow_methods=["*"],
|
# allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
# allow_headers=["*"],
|
||||||
)
|
# )
|
||||||
|
|
||||||
routers_list = [
|
routers_list = [
|
||||||
routers.attribute_router,
|
routers.attribute_router,
|
||||||
|
|||||||
Reference in New Issue
Block a user