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

feat(statement.cr): add retry logic to perform_query and perform_exec #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@dukenguyenxyz dukenguyenxyz self-assigned this Sep 3, 2021
raise "expected RowDescription or NoData, got #{frame}"
retry do
begin
params = args.map { |arg| PQ::Param.encode(arg) }
Copy link

Choose a reason for hiding this comment

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

Can this be done outside the retry block?

Copy link

Choose a reason for hiding this comment

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

Why can't use the DB pool retry where the connection is dispatched rather than in the statement? https://github.com/crystal-lang/crystal-db/blob/master/src/db/pool.cr#L165-L191

Copy link
Author

Choose a reason for hiding this comment

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

we can also do that, that's probably better

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.

Application does not recover following loss of connectivity with DB
2 participants