moved shedlock code example to module "spring-boot-libraries"

This commit is contained in:
Tom Hombergs
2018-12-19 20:04:54 +01:00
parent 3064a22a7a
commit 3f6f33294b
10 changed files with 574 additions and 0 deletions
@@ -1,12 +0,0 @@
package com.baeldung.scheduling.shedlock;
import org.springframework.context.annotation.Configuration;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@EnableScheduling
@EnableSchedulerLock(defaultLockAtMostFor = "PT30S")
public class SchedulerConfiguration {
}
@@ -1,15 +0,0 @@
package com.baeldung.scheduling.shedlock;
import net.javacrumbs.shedlock.core.SchedulerLock;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
class TaskScheduler {
@Scheduled(cron = "*/15 * * * * *")
@SchedulerLock(name = "TaskScheduler_scheduledTask", lockAtLeastForString = "PT5M", lockAtMostForString = "PT14M")
public void scheduledTask() {
System.out.println("Running ShedLock task");
}
}