Skip to content

Commit

Permalink
Merge pull request #702 from jglick/cacheRootDir
Browse files Browse the repository at this point in the history
Allow `$JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache/` to be overridden
  • Loading branch information
rsandell authored Jun 5, 2023
2 parents df12377 + 9e456e1 commit d391eef
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import jenkins.model.Jenkins;
import jenkins.scm.api.SCMSourceOwner;
import jenkins.util.JenkinsJVM;
import jenkins.util.SystemProperties;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -473,7 +474,10 @@ private static Cache getCache(
Cache cache = null;
int cacheSize = GitHubSCMSource.getCacheSize();
if (cacheSize > 0) {
File cacheBase = new File(jenkins.getRootDir(), GitHubSCMProbe.class.getName() + ".cache");
String cacheRootDir = SystemProperties.getString(GitHubSCMSource.class.getName() + ".cacheRootDir");
File cacheBase = cacheRootDir != null
? new File(cacheRootDir)
: new File(jenkins.getRootDir(), GitHubSCMProbe.class.getName() + ".cache");
File cacheDir = null;
try {
MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
Expand Down

0 comments on commit d391eef

Please sign in to comment.