From 9f727077ec7ce930bf4a8415dda29daa6c8e042f Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Fri, 16 Aug 2019 13:05:51 -0500 Subject: [PATCH] Add stop file check to openDatabase --- .../databaseUtilities/DatabaseUtilities.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/hedera/databaseUtilities/DatabaseUtilities.java b/src/main/java/com/hedera/databaseUtilities/DatabaseUtilities.java index b224b165e73..279f902a313 100644 --- a/src/main/java/com/hedera/databaseUtilities/DatabaseUtilities.java +++ b/src/main/java/com/hedera/databaseUtilities/DatabaseUtilities.java @@ -1,26 +1,26 @@ package com.hedera.databaseUtilities; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.concurrent.TimeUnit; - import com.google.common.util.concurrent.Uninterruptibles; +import com.hedera.configLoader.ConfigLoader; +import com.hedera.utilities.Utility; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.Marker; -import org.apache.logging.log4j.MarkerManager; -import com.hedera.configLoader.ConfigLoader; +import java.sql.*; +import java.util.concurrent.TimeUnit; public class DatabaseUtilities { - private static final Logger log = LogManager.getLogger("databaseUtilities"); - static final Marker LOGM_EXCEPTION = MarkerManager.getMarker("EXCEPTION"); + private static final Logger log = LogManager.getLogger(DatabaseUtilities.class); public static Connection openDatabase(Connection connect) { if (connect == null) { while (true) { try { + if (Utility.checkStopFile()) { + log.info("Stop file found, stopping."); + break; + } + // Setup the connection with the DB String url = ConfigLoader.getDBUrl(); String userName = ConfigLoader.getDBUserName();