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:
|
||||
print(e)
|
||||
|
||||
# consumer_task = asyncio.create_task(consume_messages())
|
||||
consumer_task = asyncio.create_task(consume_messages())
|
||||
|
||||
yield
|
||||
producer = await get_producer()
|
||||
if producer:
|
||||
await producer.stop()
|
||||
# consumer_task.cancel()
|
||||
consumer_task.cancel()
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan, separate_input_output_schemas=False, root_path='/api')
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
# app.add_middleware(
|
||||
# CORSMiddleware,
|
||||
# allow_origins=origins,
|
||||
# allow_credentials=True,
|
||||
# allow_methods=["*"],
|
||||
# allow_headers=["*"],
|
||||
# )
|
||||
|
||||
routers_list = [
|
||||
routers.attribute_router,
|
||||
|
||||
Reference in New Issue
Block a user