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

Helper methods to use a Jedis object #3520

Closed
wants to merge 6 commits into from
Closed

Helper methods to use a Jedis object #3520

wants to merge 6 commits into from

Conversation

oscar-besga-panel
Copy link
Contributor

A couple of simple methods to operate with a Jedis object with JedisPool and JedisPooled without worrying about closing resources.

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (d023d2f) 71.25% compared to head (f00e232) 71.25%.
Report is 3 commits behind head on master.

❗ Current head f00e232 differs from pull request most recent head 6b43f98. Consider uploading reports for the commit 6b43f98 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3520      +/-   ##
============================================
- Coverage     71.25%   71.25%   -0.01%     
- Complexity     4765     4769       +4     
============================================
  Files           277      277              
  Lines         14999    15010      +11     
  Branches       1057     1057              
============================================
+ Hits          10688    10695       +7     
- Misses         3848     3850       +2     
- Partials        463      465       +2     
Files Changed Coverage Δ
src/main/java/redis/clients/jedis/JedisPool.java 61.06% <100.00%> (+1.54%) ⬆️
src/main/java/redis/clients/jedis/JedisPooled.java 26.08% <100.00%> (+3.35%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -401,4 +403,21 @@ public final Pool<Connection> getPool() {
public Pipeline pipelined() {
return (Pipeline) super.pipelined();
}

public Jedis newJedis() {
return new Jedis(getPool().getResource());
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bears the similar issue stated in #3533 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I didn't know this was there.
I'll close this PR and make one that limits helpers to JedisPool
I think now that JedisPooled doesn't need helpers like I've done

Thanks

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