| 1 | package org.sanmibuh.tedee.lock.infrastructure.primary; | |
| 2 | ||
| 3 | import java.time.ZoneId; | |
| 4 | import lombok.RequiredArgsConstructor; | |
| 5 | import org.springframework.scheduling.annotation.SchedulingConfigurer; | |
| 6 | import org.springframework.scheduling.config.CronTask; | |
| 7 | import org.springframework.scheduling.config.ScheduledTaskRegistrar; | |
| 8 | import org.springframework.scheduling.support.CronTrigger; | |
| 9 | import org.springframework.stereotype.Component; | |
| 10 | ||
| 11 | @Component | |
| 12 | @RequiredArgsConstructor | |
| 13 | public final class LockSchedulingConfigurer implements SchedulingConfigurer { | |
| 14 | ||
| 15 | private final LockSchedulerProperties properties; | |
| 16 | private final LockScheduler scheduler; | |
| 17 | ||
| 18 | @Override | |
| 19 | public void configureTasks(final ScheduledTaskRegistrar registrar) { | |
| 20 | final var zone = ZoneId.of(properties.zone()); | |
| 21 | properties | |
| 22 | .schedules() | |
| 23 |
1
1. configureTasks : removed call to java/util/Map::forEach → KILLED |
.forEach( |
| 24 | (deviceId, cron) -> | |
| 25 |
1
1. lambda$configureTasks$0 : removed call to org/springframework/scheduling/config/ScheduledTaskRegistrar::addCronTask → KILLED |
registrar.addCronTask( |
| 26 | new CronTask( | |
| 27 |
1
1. lambda$configureTasks$1 : removed call to org/sanmibuh/tedee/lock/infrastructure/primary/LockScheduler::closeLock → KILLED |
() -> scheduler.closeLock(deviceId), new CronTrigger(cron, zone)))); |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 23 |
1.1 |
|
| 25 |
1.1 |
|
| 27 |
1.1 |