Search in sources :

Example 1 with SchedulerLock

use of net.javacrumbs.shedlock.micronaut.SchedulerLock in project ShedLock by lukas-krecan.

the class ScheduledTasks method reportCurrentTime.

@Scheduled(fixedRate = "100ms")
@SchedulerLock(name = "reportCurrentTime")
public void reportCurrentTime() {
    assertLocked();
    called.set(true);
    System.out.println(new Date());
}
Also used : Date(java.util.Date) Scheduled(io.micronaut.scheduling.annotation.Scheduled) SchedulerLock(net.javacrumbs.shedlock.micronaut.SchedulerLock)

Example 2 with SchedulerLock

use of net.javacrumbs.shedlock.micronaut.SchedulerLock in project ShedLock by lukas-krecan.

the class ScheduledTasks method reportCurrentTime.

@Scheduled(fixedRate = "100ms")
@SchedulerLock(name = "reportCurrentTime")
public void reportCurrentTime() {
    assertLocked();
    called.set(true);
    System.out.println(new Date());
}
Also used : Date(java.util.Date) Scheduled(io.micronaut.scheduling.annotation.Scheduled) SchedulerLock(net.javacrumbs.shedlock.micronaut.SchedulerLock)

Aggregations

Scheduled (io.micronaut.scheduling.annotation.Scheduled)2 Date (java.util.Date)2 SchedulerLock (net.javacrumbs.shedlock.micronaut.SchedulerLock)2