2021-03-16 14:25:15 +01:00
|
|
|
package eu.openaire.urls_controller.components;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2021-12-21 14:55:27 +01:00
|
|
|
//import org.springframework.scheduling.annotation.Scheduled;
|
2021-03-16 14:25:15 +01:00
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
|
@Component
|
|
|
|
public class ScheduledTasks {
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ScheduledTasks.class);
|
|
|
|
|
|
|
|
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
|
|
|
|
|
2021-11-09 22:59:27 +01:00
|
|
|
//@Scheduled(fixedRate = 600_000) // Run every 10 mins: 600_000
|
2021-03-16 14:25:15 +01:00
|
|
|
public void reportCurrentTime() {
|
|
|
|
logger.info("Server is live! Time is now {}", dateFormat.format(new Date()));
|
|
|
|
}
|
|
|
|
}
|