change stop loop function
This commit is contained in:
8
main.py
8
main.py
@@ -33,13 +33,7 @@ async def startup(fast_api: FastAPI):
|
||||
yield
|
||||
finally:
|
||||
# Shutdown logic
|
||||
internal_loop_stop()
|
||||
try:
|
||||
await task
|
||||
print("Cancelled")
|
||||
except asyncio.CancelledError:
|
||||
print("Cancelled exception")
|
||||
pass
|
||||
await internal_loop_stop(task)
|
||||
await influxdb_client.close()
|
||||
mysql_engine = get_mysql_engine()
|
||||
await mysql_client.close()
|
||||
|
||||
Reference in New Issue
Block a user