mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-20 16:20:18 +00:00
Refactor tests and start work on database integration.
This commit is contained in:
@ -25,7 +25,8 @@ from gns3server.controller import Controller
|
||||
from gns3server.compute import MODULES
|
||||
from gns3server.compute.port_manager import PortManager
|
||||
from gns3server.utils.http_client import HTTPClient
|
||||
#from gns3server.db.tasks import connect_to_db, close_db_connection
|
||||
from gns3server.db.tasks import connect_to_db
|
||||
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@ -54,7 +55,7 @@ def create_startup_handler(app: FastAPI) -> Callable:
|
||||
loop.set_debug(True)
|
||||
|
||||
# connect to the database
|
||||
# await connect_to_db(app)
|
||||
await connect_to_db()
|
||||
|
||||
await Controller.instance().start()
|
||||
# Because with a large image collection
|
||||
@ -89,7 +90,4 @@ def create_shutdown_handler(app: FastAPI) -> Callable:
|
||||
if PortManager.instance().udp_ports:
|
||||
log.warning("UDP ports are still used {}".format(PortManager.instance().udp_ports))
|
||||
|
||||
# close the connection to the database
|
||||
# await close_db_connection(app)
|
||||
|
||||
return shutdown_handler
|
||||
|
Reference in New Issue
Block a user