Skip to content

Commit e836ce3

Browse files
baltzelltongtongcao
authored andcommitted
lazy-connect
1 parent 41e3275 commit e836ce3

File tree

1 file changed

+3
-4
lines changed
  • common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils

1 file changed

+3
-4
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/RCDBProvider.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ public class RCDBProvider {
1616

1717
public static class RCDBManager {
1818
HashMap<Integer,RCDBConstants> cache = new HashMap<>();
19-
RCDBProvider provider = new RCDBProvider();
19+
RCDBProvider provider = null;
2020
public synchronized RCDBConstants getConstants(int run) {
21-
if (!cache.containsKey(run)) {
22-
cache.put(run, provider.getConstants(run));
23-
}
21+
if (provider == null) provider = new RCDBProvider();
22+
if (!cache.containsKey(run)) cache.put(run, provider.getConstants(run));
2423
return cache.get(run);
2524
}
2625
public Double getTorusScale(int run) {

0 commit comments

Comments
 (0)