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

Check the connection before logging statements #78

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

djmb
Copy link
Contributor

@djmb djmb commented Oct 19, 2022

If the database connection has been lost you can't reconnect because console1984 raises an error when it tries to record the statement.

Let's check the connection first and reconnect if it is not active.

cc @jorgemanrubia

If the database connection has been lost you can't reconnect because
console1984 raises an error when it tries to record the statement.

Let's check the connection first and reconnect if it is not active.
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

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

Looks great @djmb.

Maybe we could add a wrapper helper silence_logging_and_ensure_connected that does both things to remove the dups? 🤔. In any case good call to place this logic here in the database logger 👍.

@jorgemanrubia jorgemanrubia merged commit 02a0145 into master Nov 23, 2022
@jorgemanrubia jorgemanrubia deleted the check-connection-before-logging-statements branch November 23, 2022 21:22
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.

2 participants