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

🧹 Initialize database on app start-up #5630

Merged
merged 5 commits into from
Jul 30, 2024
Merged

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Jun 25, 2024

Moves the database initialization to the constructor of the Database object, and then calling it on __main__, this way we have a bit more control in the order of execution of these steps.

Fixes #5609

How to test

All tests should pass, and the database type checker should work as well.

@jpelay jpelay marked this pull request as ready for review June 27, 2024 20:36
@jpelay jpelay requested a review from rix0rrr June 27, 2024 20:36
Copy link
Collaborator

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

mergify bot commented Jul 30, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Jul 30, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 180894e into main Jul 30, 2024
12 checks passed
@mergify mergify bot deleted the database_initialization branch July 30, 2024 13:35
@jpelay jpelay restored the database_initialization branch July 30, 2024 17:03
Copy link
Contributor

mergify bot commented Jul 30, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

mergify bot pushed a commit that referenced this pull request Jul 31, 2024
QA is down because of a recent PR we merged today: #5630 This PR failed to take into account that Heroku uses the function `post_fork` in `gunicorn.conf.py` and not the `if __name__ == '__main__'` located in `app.py`

**How to test**

Everything should work, but the real test is on Alpha.
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.

🪲 Initialize DB tables on app inizialitation
2 participants