💚 fix: Enhance database configuration handling and improve data cleanup logic
This commit is contained in:
parent
86a462a636
commit
261e2ceaa9
2 changed files with 4 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ public class Config {
|
|||
|
||||
public static final String DB_HOST = System.getenv("DB_HOST");
|
||||
|
||||
public static final int DB_PORT = Convert.toInt(System.getenv("DB_PORT"));
|
||||
public static final int DB_PORT = Convert.toInt(System.getenv("DB_PORT"), 0);
|
||||
|
||||
public static final String DB_USER = System.getenv("DB_USER");
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ public class DataVerticleTest {
|
|||
|
||||
public static Future<Void> clear(Vertx vertx) {
|
||||
if (Config.isSqlite()) {
|
||||
String dataPath = DataVerticle.getDataPath();
|
||||
if (FileUtil.file(dataPath).exists()) {
|
||||
FileUtil.del(dataPath);
|
||||
String appRoot = Config.APP_ROOT;
|
||||
if (FileUtil.file(appRoot).exists()) {
|
||||
FileUtil.clean(appRoot);
|
||||
}
|
||||
return Future.succeededFuture();
|
||||
} else if (Config.isPostgres()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue