fix: Extract user name in session context for improved performance
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user