-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: db pool for histogram calc #174
Conversation
okay this is actually ready now. Very odd asyncio event loop issues in prod I was dealing with. |
CMD exec poetry run uvicorn zeno_backend.server:get_server --reload --host 0.0.0.0 --port 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running it as a module didn't create an event loop in asyncio oddly. Also matches the dev setup.
return db | ||
|
||
|
||
db_pool = AsyncConnectionPool(" ".join([f"{k}={v}" for k, v in config().items()])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually probably want to switch most queries to this, but it's okay to have both for now IMO
Description
Actually use asyncio for DB calculations using an async DB pool. Speeds up by a factor of features being calculated, e.g. 5x for translation.