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

Separate cache for each server config #93

Merged
merged 1 commit into from
Oct 6, 2015

Conversation

lanwen
Copy link
Member

@lanwen lanwen commented Oct 4, 2015

This change requires java 1.7 to use java.nio as more effective way to operate files.
This implementation creates directory with name as hash of each pair <api url+creds>.
Redundant dirs removed on each save of global config.

  • add the javadocs
  • some tests for cleanup of cache dirs

@lanwen lanwen changed the title separate cache for each server config [wip] separate cache for each server config Oct 4, 2015
@@ -180,8 +180,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
Copy link
Member

Choose a reason for hiding this comment

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

TODO don't forget mark in changelog 1.7 requirement

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@lanwen lanwen force-pushed the separate_cache branch 3 times, most recently from 9266983 to f153264 Compare October 5, 2015 22:15
This change requires java 1.7 to use java.nio as more effective way to operate files.
This implementation creates directory with name as hash of each pair <api url+creds>.
Redundant dirs removed on each save of global config.
@lanwen lanwen changed the title [wip] separate cache for each server config Separate cache for each server config Oct 5, 2015
private OkHttpConnector connector(String apiUrl) {
OkHttpClient client = new OkHttpClient().setProxy(getProxy(apiUrl));
private OkHttpConnector connector(GitHubServerConfig config) {
OkHttpClient client = new OkHttpClient().setProxy(getProxy(defaultIfBlank(config.getApiUrl(), GITHUB_URL)));
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't this mask issue when something is broken and url get blank?
i.e. user entered url, jelly magic failed, connection created with public connection and user didn't get thrown error

Copy link
Member Author

Choose a reason for hiding this comment

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

Insurance just in case. This should never happen until somebody will call directly classes from internals

@KostyaSha
Copy link
Member

👍 LGTM besides using defaults when real url is expected.

KostyaSha added a commit that referenced this pull request Oct 6, 2015
Separate cache for each server config
@KostyaSha KostyaSha merged commit abe3c9b into jenkinsci:master Oct 6, 2015
@lanwen lanwen deleted the separate_cache branch October 6, 2015 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants