Remove remaining dead timing variables and imports

This commit is contained in:
YueGuobin 2026-06-16 00:40:03 +08:00
parent a8cc01af46
commit bd15c8d019
No known key found for this signature in database
4 changed files with 0 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)