From f598ec2c12129f99a4baacfb3218305fbce23350 Mon Sep 17 00:00:00 2001 From: JSC Date: Sun, 17 Aug 2025 01:49:47 +0200 Subject: [PATCH] fix: Extract user name in session context for improved performance --- app/services/extraction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/extraction.py b/app/services/extraction.py index 457bd51..3238ac9 100644 --- a/app/services/extraction.py +++ b/app/services/extraction.py @@ -75,6 +75,9 @@ class ExtractionService: msg = f"User {user_id} not found" raise ValueError(msg) + # Extract user name immediately while in session context + user_name = user.name + # Create the extraction record without service detection for fast response extraction_data = { "url": url, @@ -101,7 +104,7 @@ class ExtractionService: "error": extraction.error, "sound_id": extraction.sound_id, "user_id": extraction.user_id, - "user_name": user.name, + "user_name": user_name, "created_at": extraction.created_at.isoformat(), "updated_at": extraction.updated_at.isoformat(), }