0
This guy is the Scheduled, he is triggered when the project is executed. Just as he is is in the automatic. I wish instead of being on automatic be triggered only when called, someone has an idea of how could do this?
@Scheduled(cron="*/50 * 02-23 ? * *") // 10 em 10 segundos executa das 02:00 horas até as 23:00 (23:59)
public void processarJOB() {
System.out.println("inicio processarJOB --> processando: " + new Timestamp(new Date().getTime()));
Locale.setDefault(new Locale("pt", "BR"));
try {
if(!executandoJob) {
executandoJob = true;
processarPrestacao();
executandoJob = false;
}
} catch (Exception e) {
executandoJob = false;
logger.error("" , e);
}
}
Do you want to enable scheduling after a user action for example? That’s it?
– Filipe L. Constante
Positive, that’s right, I found something similar, but still do not understand how to adapt to the context of my code. https://stackoverflow.com/questions/18406713/how-to-conditionally-enable-or-disable-scheduled-jobs-in-spring
– wladyband
Dude, I know I can do just that and I’m gonna need that too, so I’ll research. If I can find the solution I put here.
– Filipe L. Constante