This commit is contained in:
@@ -4,13 +4,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.kafka.core.KafkaTemplate;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import ru.soune.nocopy.dto.monitoring.MonitoringDTO;
|
|
||||||
import ru.soune.nocopy.entity.file.FileStatus;
|
import ru.soune.nocopy.entity.file.FileStatus;
|
||||||
import ru.soune.nocopy.entity.monitoring.FileMonitoringEntity;
|
import ru.soune.nocopy.entity.monitoring.FileMonitoringEntity;
|
||||||
import ru.soune.nocopy.entity.notification.NotificationType;
|
import ru.soune.nocopy.entity.notification.NotificationType;
|
||||||
@@ -35,14 +32,8 @@ public class MonitoringScheduler {
|
|||||||
|
|
||||||
private final NotificationService notificationService;
|
private final NotificationService notificationService;
|
||||||
|
|
||||||
private final KafkaTemplate<Object, String> kafkaTemplate;
|
// @Scheduled(cron = "0 1 2 * * *", zone = "Europe/Moscow")
|
||||||
|
@Scheduled(cron = "0 */2 * * * *", zone = "Europe/Moscow")
|
||||||
private final ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
@Value("${server.baseurl}")
|
|
||||||
private String baseUrl;
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 1 2 * * *", zone = "Europe/Moscow")
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void processScheduledMonitoring() {
|
public void processScheduledMonitoring() {
|
||||||
log.info("Starting scheduled monitoring check at 02:01 MSK");
|
log.info("Starting scheduled monitoring check at 02:01 MSK");
|
||||||
@@ -55,7 +46,6 @@ public class MonitoringScheduler {
|
|||||||
|
|
||||||
log.info("Found {} files ready for monitoring", readyForRun.size());
|
log.info("Found {} files ready for monitoring", readyForRun.size());
|
||||||
|
|
||||||
//TODO check tokens for apply
|
|
||||||
for (FileMonitoringEntity monitoring: readyForRun) {
|
for (FileMonitoringEntity monitoring: readyForRun) {
|
||||||
try {
|
try {
|
||||||
monitoringSearchService.processFileSearch(monitoring);
|
monitoringSearchService.processFileSearch(monitoring);
|
||||||
|
|||||||
Reference in New Issue
Block a user