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

DB connection for request is not released when there are more than one database #15

Open
kigawas opened this issue Sep 9, 2020 · 1 comment · May be fixed by #16
Open

DB connection for request is not released when there are more than one database #15

kigawas opened this issue Sep 9, 2020 · 1 comment · May be fixed by #16

Comments

@kigawas
Copy link

kigawas commented Sep 9, 2020

With use_connection_for_request=True and two DBs:

db1.init_app(app)
db2.init_app(app)

And in the fastapi router, query db1 and db2.

  1. Call the api
  2. Change file contents to make it reload
  3. Try exiting

Then you'll see the server gets stuck.

@kigawas
Copy link
Author

kigawas commented Sep 9, 2020

I guess the problem is in _Middleware, when setting scope, one connection overrides another.

@kigawas kigawas linked a pull request Sep 10, 2020 that will close this issue
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 a pull request may close this issue.

1 participant