I have some question related to the @Scheduled task in spring boot application
I have some microservice that send an email every month. I have @Scheduled(cron="every month expression"). But just imagine that I have run this service for 15 days (but we need 30 days to send email) and on 16-day service restarted or crashed and after some time wake up again. This job will start count 1 month again with the first day or continue with 16 and so on days?
@Scheduled(cron="0 0 0 1 * *")
public void sendEmail() {
emailService.sendEmail();
}
I need that after the server crashes, let's say for 15 days this task continues from 15 days and after 15 days sent a letter, but did not start counting again from the first day