I have in the main class that starts the app:
@SpringBootApplication
@EnableAsync
public class ExperianRequestBotApplication extends RefApplication {
public ExperianRequestBotApplication() throws RefException {
super();
}
public static void main(String[] args) throws RefException {
try {
new ExperianRequestBotApplication().start(args);
} catch (Exception e) {
System.out.println(" ------- OFFLINE ------- ");
System.out.println("La aplicación no esta disponible por :" + e);
}
}
}
and a scheduler
@Component
public class ScheduledTaskSincronizarContactos {
@Autowired
private ExperianRequestBotService experianRequestBotService;
private final static Logger LOG = LoggerFactory.getLogger(ScheduledTaskSincronizarContactos.class);
// Método Shedule encargado de sincronizar los usuarios modificados con Experian
@Async
@Scheduled(cron = "0 */15 * ? * *")
public void SincronizarContactos() throws Exception {
I want to prevent the scheduler from being launched again if the internal process takes more than 15 minutes to start the task again.
I can't find the way. I have tried implementing @DisallowConcurrentExecution with the quartz library but it is still concurrent.
Any ideas?