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