File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11package org .jlab .detector .calib .utils ;
22
3+ import java .lang .Thread ;
34import java .util .ArrayList ;
45import java .util .Arrays ;
56import java .util .HashMap ;
1920 */
2021public class ConstantsManager {
2122
23+ public static final int DBERROR_SLEEP_SECONDS =3 ;
24+
2225 private static Logger LOGGER = Logger .getLogger (ConstantsManager .class .getName ());
2326
2427 private DatabaseConstantsDescriptor defaultDescriptor = new DatabaseConstantsDescriptor ();
@@ -116,6 +119,11 @@ private synchronized void loadConstantsForRun(int run) {
116119 LOGGER .log (Level .SEVERE ,
117120 "[ConstantsManager] exceeded maximum requests " + requests + " for run " + run );
118121 }
122+ else if (requests > 1 ) {
123+ LOGGER .log (Level .SEVERE ,"[ConstantsManager] sleeping a bit before trying again ..." );
124+ try { Thread .sleep (DBERROR_SLEEP_SECONDS *1000 ); }
125+ catch (InterruptedException e ) {}
126+ }
119127 }
120128
121129 LOGGER .log (Level .INFO , "[ConstantsManager] ---> loading table for run = " + run );
You can’t perform that action at this time.
0 commit comments