aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-home
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-12 17:00:37 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-13 15:34:17 +0200
commit542b5c9d4e53be42ba3343cbc2ab62a764d4e904 (patch)
tree672e57515b89a05a8587885b659ecc86b67e4531 /sonar-home
parentda1cbd3a083fd60520de77d3b1bf4c586cfd1b74 (diff)
downloadsonarqube-542b5c9d4e53be42ba3343cbc2ab62a764d4e904.tar.gz
sonarqube-542b5c9d4e53be42ba3343cbc2ab62a764d4e904.zip
SONAR-6785 Optimize project sync with multithreading
Diffstat (limited to 'sonar-home')
-rw-r--r--sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java b/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
index 918f2b1a147..2193f5a1ba4 100644
--- a/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
+++ b/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
@@ -46,12 +46,11 @@ public class PersistentCache {
private static final String DIGEST_ALGO = "MD5";
private static final String LOCK_FNAME = ".lock";
- private Path baseDir;
-
// eviction strategy is to expire entries after modification once a time duration has elapsed
private final long defaultDurationToExpireMs;
private final Logger logger;
private final String version;
+ private final Path baseDir;
public PersistentCache(Path baseDir, long defaultDurationToExpireMs, Logger logger, String version) {
this.baseDir = baseDir;
@@ -63,7 +62,7 @@ public class PersistentCache {
logger.debug("cache: " + baseDir + ", default expiration time (ms): " + defaultDurationToExpireMs);
}
- public void reconfigure() {
+ public synchronized void reconfigure() {
try {
Files.createDirectories(baseDir);
} catch (IOException e) {