Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create superuser at startup to avoid concurrency issues #2019

Merged
merged 4 commits into from
May 30, 2024

Conversation

nicoloboschi
Copy link
Collaborator

Currently if auto_login = true, the super user is being initialized when the auto_login endpoint is called the first time.
This has multiple problems:

  1. If two concurrent calls happen, one of the client gets an error
  2. since the API auth header is not needed in this mode, without calling auto_login is not possible to call other endpoints.

Changes:

  • Moved superuser initialization at the startup
  • The auto_login endpoint just generates the long term token

Copy link

vercel bot commented May 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:48pm

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels May 30, 2024
Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 30, 2024
@ogabrielluiz ogabrielluiz merged commit 4412151 into langflow-ai:dev May 30, 2024
8 of 11 checks passed
@nicoloboschi nicoloboschi deleted the early-init-superuser branch May 30, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants