Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@slievrly
Copy link
Member

@slievrly slievrly commented Jul 4, 2023

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

optimize distributed lock log

Ⅱ. Does this pull request fix one issue?

fix #5684

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: slievrly <[email protected]>
}

private boolean ignoreSQLException(SQLException exception) {
if (IGNORE_MYSQL_CODE.contains(exception.getErrorCode())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

return IGNORE_MYSQL_CODE.contains(exception.getErrorCode()) ||
       (StringUtils.isNotBlank(exception.getMessage()) && IGNORE_MYSQL_MESSAGE.stream().anyMatch(message -> exception.getMessage().contains(message)));

Copy link
Member Author

Choose a reason for hiding this comment

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

Long bool judgment expressions are not recommended, as they become less readable.

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