This commit is contained in:
Braydon 2024-04-22 23:12:02 -04:00
parent 7b602a0f21
commit 90aea4a9cc
2 changed files with 1 additions and 11 deletions

@ -35,19 +35,9 @@ public final class EnvironmentUtils {
* Is the app running in a production environment? * Is the app running in a production environment?
*/ */
@Getter private static final boolean production; @Getter private static final boolean production;
/**
* Is the app running in a test environment?
*/
@Getter private static boolean testing;
static { static {
// Are we running on production? // Are we running on production?
String appEnv = System.getenv("APP_ENV"); String appEnv = System.getenv("APP_ENV");
production = appEnv != null && (appEnv.equals("production")); production = appEnv != null && (appEnv.equals("production"));
// Are we running on a test environment?
String testEnv = System.getenv("SPRING_TEST");
testing = testEnv != null && (testEnv.equals("true"));
} }
} }

@ -72,7 +72,7 @@ public final class MaxMindService {
@PostConstruct @PostConstruct
public void onInitialize() { public void onInitialize() {
// Load the databases // Load the databases
if (!EnvironmentUtils.isTesting()) { if (EnvironmentUtils.isProduction()) {
loadDatabases(); loadDatabases();
} }
} }