Skip to content

Conversation

@dougfales
Copy link

A small change to include --super-read-only errors in the criteria for deciding to attempt a reconnect.

Copy link
Owner

@alfa-jpn alfa-jpn left a comment

Choose a reason for hiding this comment

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

@dougfales

Sorry for the late reply.

Thanks for great PR!

Please check some comments. 🙏
Also, Can you write a test code?

https://github.com/alfa-jpn/mysql2-aurora/blob/master/spec/mysql2/aurora_spec.rb#L88

reconnect!
end

def read_only_error?(msg)
Copy link
Owner

Choose a reason for hiding this comment

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

nits: Please write a comment with yard format 🙏

Comment on lines +23 to +24
return false if msg.nil?
msg.include?('--read-only') || msg.include?('--super-read-only')
Copy link
Owner

Choose a reason for hiding this comment

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

imho: I think this is better, but how about it?

!msg.nil? && ['--read-only', '--super-read-only'].any? { |term| msg.include?(term) }

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