Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jlab.detector.calib.utils;

import java.lang.Thread;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand All @@ -19,6 +20,8 @@
*/
public class ConstantsManager {

public static final int DBERROR_SLEEP_SECONDS=3;

private static Logger LOGGER = Logger.getLogger(ConstantsManager.class.getName());

private DatabaseConstantsDescriptor defaultDescriptor = new DatabaseConstantsDescriptor();
Expand Down Expand Up @@ -116,6 +119,11 @@ private synchronized void loadConstantsForRun(int run) {
LOGGER.log(Level.SEVERE,
"[ConstantsManager] exceeded maximum requests " + requests + " for run " + run);
}
else if (requests > 1) {
LOGGER.log(Level.SEVERE,"[ConstantsManager] sleeping a bit before trying again ...");
try { Thread.sleep(DBERROR_SLEEP_SECONDS*1000); }
catch (InterruptedException e) {}
}
}

LOGGER.log(Level.INFO, "[ConstantsManager] ---> loading table for run = " + run);
Expand Down
Loading