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

🤖 Enhance Database Initialization with Thread Safety and Logging #1737

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sentry-autofix[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Rohan Agarwal

Fixes SEER-9P

This pull request introduces thread safety and logging enhancements to the database initialization process in the application. In 'src/celery_app/app.py', debug logging is added to track the Celery worker's database connection status. In 'src/seer/db.py', a threading lock is introduced to prevent concurrent database initialization, ensuring that initialization occurs only once. The existing initialization code is modified to check if the database has already been initialized, and if so, it ensures that the session is correctly bound. Exception handling is added to reset the initialization flag upon failure. Finally, in 'src/seer/bootup.py', debug statements are added to log the progress of the database initialization.

If you have any questions or feedback for the Sentry team about this fix, please email autofix@sentry.io with the Run ID: 3126.

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.

0 participants