8000 fix(backend): only do one db lookup in get_or_create_user by c0rydoras · Pull Request #1646 · adfinis/timed · GitHub
[go: up one dir, main page]

Skip to content

fix(backend): only do one db lookup in get_or_create_user - #1646

Open
c0rydoras wants to merge 1 commit into
adfinis:mainfrom
c0rydoras:fix/backend/two-queries-per-uncached-auth-token-whatever
Open

c0rydoras wants to merge 1 commit into
adfinis:mainfrom
c0rydoras:fix/backend/two-queries-per-uncached-auth-token-whatever

Conversation

@c0rydoras
Copy link
Copy Markdown
Collaborator

before

len(users) -> a query
users.get() -> another query

now

just one query.
in the edge case of there being 2 users matching the filter (which should never happen), the first one is used, contrary to trying to create a third one 👍 (or logging an error)

we could also use .get() so we fail if more than one is returned.

@c0rydoras
c0rydoras requested a review from a team as a code owner December 4, 2026 16:59
@c0rydoras
c0rydoras requested a review from trowik December 4, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0