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

HikariCP config fix #1035

Merged
merged 9 commits into from
Apr 24, 2024
Merged

HikariCP config fix #1035

merged 9 commits into from
Apr 24, 2024

Conversation

saquino0827
Copy link
Contributor

Add a PR title

Fixes maxLifetime settings for HikariCP.

Issue

Add a link to the issue here. Consider using
closing keywords
if the this PR isn't for a story (stories will be closed through different means).

Checklist

  • I have added tests to cover my changes
  • I have added logging where useful (with appropriate log level)
  • I have added JavaDocs where required
  • I have updated the documentation accordingly

Note: You may remove items that are not applicable

@@ -41,7 +43,8 @@ static HikariConfig constructHikariConfig() {
String serverName = ApplicationContext.getProperty("DB_URL", "");
String dbName = ApplicationContext.getProperty("DB_NAME", "");
String dbPort = ApplicationContext.getProperty("DB_PORT", "");
String connectionLifetime = ApplicationContext.getProperty("DB_MAX_LIFETIME", "1800000");
long connectionLifetime =
parseLong(ApplicationContext.getProperty("DB_MAX_LIFETIME", "1800000"));
Copy link
Member

Choose a reason for hiding this comment

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

Let's not static import a method from a class.

Suggested change
parseLong(ApplicationContext.getProperty("DB_MAX_LIFETIME", "1800000"));
Long.parseLong(ApplicationContext.getProperty("DB_MAX_LIFETIME", "1800000"));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Nice, but I would address the CodeQL notice.

saquino0827 and others added 2 commits April 23, 2024 15:25
Add catch for NumberFormatException

Co-Authored-By: jherrflexion <[email protected]>
luis-pabon-tf and others added 2 commits April 23, 2024 16:56
Refactoring DB_MAX_LIFETIME handling

Co-Authored-By: Samuel Aquino <[email protected]>
Add more test cases

Co-Authored-By: Samuel Aquino <[email protected]>
@saquino0827
Copy link
Contributor Author

Nice, but I would address the CodeQL notice.

Fixed that and added some test coverage with @luis-pabon-tf

Copy link

@saquino0827 saquino0827 merged commit e3208f9 into main Apr 24, 2024
15 checks passed
@saquino0827 saquino0827 deleted the story/1001/stg-db-connections branch April 24, 2024 14:09
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.

3 participants