[Fix] SQL Timings only in dev mode

This commit is contained in:
Rsl1122 2018-10-26 12:59:21 +03:00
parent a2b6a3b1e5
commit 6aed02e43b

View File

@ -276,7 +276,9 @@ public abstract class SQLDB extends Database {
try {
connection = getConnection();
// Inject Timings to the statement for benchmarking
statement.setTimings(timings);
if (config.isTrue(Settings.DEV_MODE)) {
statement.setTimings(timings);
}
try (PreparedStatement preparedStatement = connection.prepareStatement(statement.getSql())) {
return statement.execute(preparedStatement);
}
@ -314,7 +316,9 @@ public abstract class SQLDB extends Database {
try {
connection = getConnection();
// Inject Timings to the statement for benchmarking
statement.setTimings(timings);
if (config.isTrue(Settings.DEV_MODE)) {
statement.setTimings(timings);
}
try (PreparedStatement preparedStatement = connection.prepareStatement(statement.getSql())) {
statement.executeBatch(preparedStatement);
}
@ -330,7 +334,9 @@ public abstract class SQLDB extends Database {
try {
connection = getConnection();
// Inject Timings to the statement for benchmarking
statement.setTimings(timings);
if (config.isTrue(Settings.DEV_MODE)) {
statement.setTimings(timings);
}
try (PreparedStatement preparedStatement = connection.prepareStatement(statement.getSql())) {
return statement.executeQuery(preparedStatement);
}