final cleanup for tue

This commit is contained in:
Tibor Tarnai 2019-12-10 22:49:00 +01:00
parent 3ce63bf91c
commit 052e7c5793
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import static com.sap.tamagotchi.service.TamagotchiService.DEVICE_EVENT_PROCESSOR_SCHEDULE;
@Service
public class Owner {
@ -18,7 +20,7 @@ public class Owner {
this.tamagotchiService = tamagotchiService;
}
@Scheduled(fixedDelay = 5000)
@Scheduled(fixedDelay = DEVICE_EVENT_PROCESSOR_SCHEDULE)
public void setData() {
for (Device d : tamagotchiService.getDevices()) {
double random = Math.random();

View file

@ -22,7 +22,7 @@ import com.sap.tamagotchi.publisher.PublisherService;
@EnableScheduling
public class TamagotchiService {
private static final long DEVICE_EVENT_PROCESSOR_SCHEDULE = 5000;
public static final long DEVICE_EVENT_PROCESSOR_SCHEDULE = 5000;
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());