Skip to content

Commit

Permalink
Add stop file check to openDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Sheehy committed Aug 16, 2019
1 parent 90905bd commit 9f72707
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/com/hedera/databaseUtilities/DatabaseUtilities.java
Original file line number Diff line number Diff line change
@@ -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();
Expand Down

0 comments on commit 9f72707

Please sign in to comment.