From 84139c9321493cc65cc6ffd2a23f6a7c4d0240f1 Mon Sep 17 00:00:00 2001 From: Fabio Faria Date: Thu, 15 Dec 2022 14:57:51 -0300 Subject: [PATCH] bug#AL-1726 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modificação sugerida --- src/com/rjconsultores/ventaboletos/FlyWay.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/FlyWay.java b/src/com/rjconsultores/ventaboletos/FlyWay.java index fbc7f7cb6..6b31f7c5b 100644 --- a/src/com/rjconsultores/ventaboletos/FlyWay.java +++ b/src/com/rjconsultores/ventaboletos/FlyWay.java @@ -148,7 +148,7 @@ public class FlyWay { try{ String ambiente = System.getProperty("ambiente") ==null || System.getProperty("ambiente").isEmpty() ? "" : System.getProperty("ambiente"); - if( AMBIENTE_DEV.equalsIgnoreCase(ambiente) || AMBIENTE_CONSULTA.equalsIgnoreCase(ambiente) ) { + if( (AMBIENTE_DEV.equalsIgnoreCase(ambiente) && AMBIENTE_CONSULTA.equalsIgnoreCase(ambiente)) && Boolean.FALSE.equals(isReloadFlyway) ) { log.warn("Flyway não executado. Ambiente = dev ou consulta"); return true; } @@ -172,11 +172,10 @@ public class FlyWay { dataSource = flyway.getDataSource(); } - - if(Boolean.TRUE.equals(isReloadFlyway)) { - execute(flyway); - log.info("Flyway executado."); - } + + execute(flyway); + log.info("Flyway executado."); + }catch(Throwable t){ log.error("Erro ao executar o Flyway",t); return false;