Skip to content

Commit

Permalink
fix : 순환참조 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo-SeongJeong committed Oct 7, 2024
1 parent 93c1832 commit a7f4213
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import chuchu.runnerway.course.entity.ElasticSearchCourse;
import chuchu.runnerway.course.model.repository.ElasticSearchCourseRepository;
import chuchu.runnerway.course.model.repository.OfficialCourseRepository;
import chuchu.runnerway.course.model.repository.UserCourseRepository;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
Expand All @@ -29,7 +28,6 @@ public class SearchCourseServiceImpl implements SearchCourseService{
private final ElasticSearchCourseRepository elasticSearchCourseRepository;
private final OfficialCourseRepository officialCourseRepository;
private final OfficialCourseService officialCourseService;
private final UserCourseRepository userCourseRepository;
private final UserCourseService userCourseService;

// 검색
Expand Down Expand Up @@ -100,7 +98,7 @@ public List<MatchByWordResponseDto> matchByWord(String searchWord) {

@Override
@Transactional
@Scheduled(cron = "0 1 3 * * *", zone = "Asia/Seoul") // 매일 새벽 3시에 elastic index 갱신
@Scheduled(cron = "0 30 * * * *", zone = "Asia/Seoul") // 매일 새벽 3시에 elastic index 갱신
public void insertCourse() {
elasticSearchCourseRepository.deleteAll();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Service
Expand All @@ -50,7 +49,6 @@ public class UserCourseServiceImpl implements UserCourseService {
}

private final WebClient webClient;
private final SearchCourseServiceImpl searchCourseServiceImpl;

@Transactional
@Override
Expand Down Expand Up @@ -140,7 +138,6 @@ else if(slopeDto.getAverageSlope() < 20) {
record.updateRecordCourse(savedCourse);
runningRecordRepository.save(record);

searchCourseServiceImpl.insertCourse();
return true;
}

Expand Down

0 comments on commit a7f4213

Please sign in to comment.