diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java index 0d18c9cca..6389cf571 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java @@ -54,15 +54,23 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit { public void init(WebApp wapp) throws Exception { Labels.register(new MyLabelLocatorGeneral((ServletContext) wapp.getNativeContext())); Labels.register(new MyLabelLocatorCliente((ServletContext) wapp.getNativeContext())); - - Constante constanteServidorException = getConstanteService().buscarPorNomeConstante("SERVIDOR_EXCEPCION_GENERACION_CORRIDA"); - String ipConstante = constanteServidorException == null ? "" : constanteServidorException.getValorconstante(); - if (!IPValidatorUtileria.ipExternoException(ipConstante)) { + + if (!ipBloqueadoGeracaoServico()) { // Generacion Automatica de Corridas jobGeneracionCorridas(); } } + private boolean ipBloqueadoGeracaoServico() { + Constante constanteServidorException = getConstanteService().buscarPorNomeConstante("SERVIDOR_EXCEPCION_GENERACION_CORRIDA"); + String ipConstante = constanteServidorException == null ? "" : constanteServidorException.getValorconstante(); + if (ipConstante.equals("")){ + return false; + } + + return (IPValidatorUtileria.ipExternoException(ipConstante)); + } + private Integer[] horaExecucion() { Constante constante = getConstanteService().buscarPorNomeConstante("HORA_GENERACION_CORRIDA");