mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-01 15:54:03 +03:00
Remove remaining dead timing variables and imports
This commit is contained in:
parent
a8cc01af46
commit
bd15c8d019
@ -43,8 +43,6 @@ async def get_user_from_token(
|
||||
token: Optional[str] = Query(None, include_in_schema=False)
|
||||
) -> schemas.User:
|
||||
|
||||
import time
|
||||
_t0 = time.time()
|
||||
|
||||
if bearer_token:
|
||||
# bearer token is used first, then any token passed as a URL parameter
|
||||
|
||||
@ -28,8 +28,6 @@ log = logging.getLogger(__name__)
|
||||
|
||||
async def get_db_session(request: HTTPConnection) -> AsyncSession:
|
||||
|
||||
import time
|
||||
_t0 = time.time()
|
||||
async with AsyncSession(request.app.state._db_engine, expire_on_commit=False) as session:
|
||||
try:
|
||||
yield session
|
||||
|
||||
@ -203,8 +203,6 @@ def _filter_node_response(node: dict, fields: list[str] = None) -> dict:
|
||||
|
||||
|
||||
def create_node_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dict[str, Any]:
|
||||
import time
|
||||
_t0 = time.time()
|
||||
|
||||
project_id = params.get("project_id")
|
||||
if not project_id:
|
||||
@ -222,7 +220,6 @@ def create_node_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dic
|
||||
results = []
|
||||
conn = _get_connector(gns3_ctx)
|
||||
def _create_one(node_data):
|
||||
_t1 = time.time()
|
||||
tid = node_data.get("template_id", default_tid)
|
||||
if not tid:
|
||||
return {"template_id": tid, "status": "error", "error": "template_id is required"}
|
||||
@ -260,7 +257,6 @@ def create_node_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dic
|
||||
if node_name:
|
||||
data["name"] = node_name
|
||||
url = f"{conn.base_url}/projects/{project_id}/templates/{template_id}"
|
||||
_t2 = time.time()
|
||||
resp = conn.http_call("post", url, json_data=data).json()
|
||||
return _filter_node_response(resp, fields)
|
||||
|
||||
|
||||
@ -260,8 +260,6 @@ class TemplatesService:
|
||||
return template
|
||||
|
||||
async def get_template(self, template_id: UUID) -> dict:
|
||||
import time
|
||||
_t0 = time.time()
|
||||
|
||||
db_template = await self._templates_repo.get_template(template_id)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user