feat:添加colg对接功能
This commit is contained in:
@@ -9,6 +9,8 @@ from fastapi import FastAPI
|
||||
from api.core import Exceptions, Gzip, Middleware
|
||||
from api.core.Logging import configure_logging
|
||||
from api.main import api_router
|
||||
from api.utils.thirdpart_gold import close_refresh_tasks
|
||||
from api.utils.gold_refresh import start_periodic_refresh, stop_periodic_refresh
|
||||
from config.main import config
|
||||
from database.connect import close_connection_pools
|
||||
|
||||
@@ -20,9 +22,12 @@ async def lifespan(_: FastAPI):
|
||||
print('dcalc is starting...')
|
||||
print('Application starting...')
|
||||
print('Application startup complete.')
|
||||
await start_periodic_refresh()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
await stop_periodic_refresh()
|
||||
await close_refresh_tasks()
|
||||
await close_connection_pools()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user