Skip to content

Comments

[fix] 스케줄러는 db를 참조하여 모집현황을 갱신한다#401

Merged
Due-IT merged 8 commits intodevelop/befrom
fix/#399-scheduler
May 19, 2025
Merged

[fix] 스케줄러는 db를 참조하여 모집현황을 갱신한다#401
Due-IT merged 8 commits intodevelop/befrom
fix/#399-scheduler

Conversation

@Due-IT
Copy link
Collaborator

@Due-IT Due-IT commented May 13, 2025

#️⃣연관된 이슈

🔧 변경 사항 요약

  • db를 참조하여 모집정보 갱신 (서버 재가동, Bypass에 의한 문제 커버)
  • RecruitmentScheduler -> RecruitmentStateChecker로 대체하여 @scheduled 기반 정적 스케줄링 적용
  • @EnableScheduling 어노테이션을 MoadongApplication에 추가하여 스케줄링 활성화
  • ClubRecruitmentInformation에 null 체크 추가
  • Club 엔티티에 모집 상태 업데이트 메서드 추가
  • 관련된 테스트 코드도 RecruitmentSchedulerTest에서 RecruitmentStateCheckerTest로 대체

논의하고 싶은 부분

RecruitmentStateChecker.performTask()를 확인해보시면 if문이 많이 사용되고, 들여쓰기가 많은 감이 있습니다. 리팩토링 시도는 해보았으나 제가 보기엔 현재 상태가 코드 읽기에도 제일 수월한거 같은데 어떻게 생각하시나요? 좋은 방법이 있다면 제안 부탁드립니다 :)

🫡 참고사항

Summary by CodeRabbit

  • 신규 기능

    • 동아리 모집 상태를 주기적으로 자동 업데이트하는 기능이 추가되었습니다.
  • 버그 수정

    • 모집 시작/종료 시간이 비어 있을 때 발생하던 오류가 수정되었습니다.
  • 리팩터

    • 기존의 모집 일정 예약 기능이 제거되고, 새로운 자동 상태 점검 방식으로 전환되었습니다.
  • 테스트

    • 새로운 모집 상태 자동 업데이트 기능에 대한 테스트가 추가되었습니다.
    • 기존 모집 일정 예약 기능 관련 테스트가 제거되었습니다.

@Due-IT Due-IT self-assigned this May 13, 2025
@Due-IT Due-IT added 🐞 Bug Something isn't working 💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels May 13, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 13, 2025

Walkthrough

이 변경은 기존의 RecruitmentScheduler 기반 개별 스케줄링 로직을 삭제하고, 전체 동아리 모집 상태를 주기적으로 일괄 점검·갱신하는 RecruitmentStateChecker 컴포넌트를 도입합니다. 이를 위해 스케줄링 활성화, 관련 서비스 및 테스트 클래스 추가·삭제, 엔티티 및 서비스 일부 메서드 수정이 이루어졌습니다.

Changes

파일/경로 변경 요약
.../MoadongApplication.java @EnableScheduling 애노테이션 추가로 스케줄링 기능 활성화
.../club/entity/Club.java updateRecruitmentStatus(ClubRecruitmentStatus) 메서드 추가
.../club/entity/ClubRecruitmentInformation.java getRecruitmentStart(), getRecruitmentEnd()에 null 체크 추가
.../club/service/ClubProfileService.java RecruitmentScheduler 필드 및 관련 로직 제거, 메서드 포맷팅 및 불필요한 코드 정리
.../club/service/RecruitmentScheduler.java RecruitmentScheduler 전체 클래스 삭제
.../club/service/RecruitmentStateChecker.java RecruitmentStateChecker 클래스 및 performTask() 메서드 신규 추가
.../global/config/SchedulerConfig.java 스케줄러 빈 설정 클래스 전체 삭제
.../test/java/moadong/club/service/RecruitmentSchedulerTest.java RecruitmentSchedulerTest 전체 테스트 클래스 삭제
.../test/java/moadong/club/service/RecruitmentStateCheckerTest.java RecruitmentStateCheckerTest 신규 테스트 클래스 추가

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler as Spring Scheduler
    participant RecruitmentStateChecker
    participant ClubRepository
    participant Club

    Scheduler->>RecruitmentStateChecker: 매 시간 performTask() 호출
    RecruitmentStateChecker->>ClubRepository: findAll()으로 전체 Club 조회
    loop 각 Club에 대해
        RecruitmentStateChecker->>Club: 모집 시작/종료일, 상태 조회
        alt 모집 상태가 ALWAYS
            RecruitmentStateChecker-->>Club: 상태 변경 없음
        else 모집 기간 비교
            RecruitmentStateChecker->>Club: 상태(UPCOMING/OPEN/CLOSED) 갱신
            RecruitmentStateChecker->>ClubRepository: save(Club)
        end
    end
Loading

Possibly related PRs

Suggested reviewers

  • Zepelown
  • PororoAndFriends

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

Test Results

28 tests   28 ✅  1s ⏱️
 9 suites   0 💤
 9 files     0 ❌

Results for commit 94fcf7f.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
backend/src/test/java/moadong/club/service/RecruitmentStateCheckerTest.java (1)

1-125: 테스트 클래스 전체 구조 우수

RecruitmentStateChecker의 다양한 상태 전환 시나리오를 잘 검증하는 테스트 클래스입니다. 각 시나리오에 대한 테스트 메서드가 명확하게 분리되어 있고, 한국어로 명명된 테스트 메서드는 테스트 의도를 명확히 전달합니다.

하지만 PR 설명에서 언급된 performTask() 메서드의 많은 if 문과 깊은 중첩에 관한 개선 방안은 이 테스트 코드에서 확인할 수 없습니다. RecruitmentStateChecker 클래스 자체를 볼 수 있다면 이에 대한 개선 제안을 할 수 있을 것입니다.

backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (2)

21-21: 주석과 실제 실행 주기가 일치하지 않습니다.

주석에는 "5분마다 실행"이라고 되어 있지만, 실제 설정된 값은 60 * 60 * 1000 (1시간)입니다. 주석을 실제 실행 주기에 맞게 수정해주세요.

- @Scheduled(fixedRate = 60 * 60 * 1000) // 5분마다 실행
+ @Scheduled(fixedRate = 60 * 60 * 1000) // 1시간마다 실행

22-50: 복잡한 중첩 조건문 리팩토링 제안

PR 설명에서 언급하셨듯이 메서드에 중첩 조건문이 많습니다. 메서드를 더 작은 단위로 분리하여 가독성을 높이는 것이 좋겠습니다.

다음과 같이 리팩토링을 제안합니다:

@Scheduled(fixedRate = 60 * 60 * 1000) // 1시간마다 실행
@Transactional
public void performTask() {
    List<Club> clubs = clubRepository.findAll();
    ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
    
    for (Club club : clubs) {
        updateClubRecruitmentStatus(club, now);
    }
}

private void updateClubRecruitmentStatus(Club club, ZonedDateTime now) {
    ClubRecruitmentInformation recruitInfo = club.getClubRecruitmentInformation();
    
    // ALWAYS 상태인 경우 처리하지 않음
    if (recruitInfo.getClubRecruitmentStatus() == ClubRecruitmentStatus.ALWAYS) {
        return;
    }
    
    ClubRecruitmentStatus newStatus = determineRecruitmentStatus(recruitInfo, now);
    club.updateRecruitmentStatus(newStatus);
    clubRepository.save(club);
}

private ClubRecruitmentStatus determineRecruitmentStatus(ClubRecruitmentInformation recruitInfo, ZonedDateTime now) {
    ZonedDateTime startDate = recruitInfo.getRecruitmentStart();
    ZonedDateTime endDate = recruitInfo.getRecruitmentEnd();
    
    // 시작일 또는 종료일이 없는 경우
    if (startDate == null || endDate == null) {
        return ClubRecruitmentStatus.CLOSED;
    }
    
    // 현재 모집 중인 경우
    if (now.isAfter(startDate) && now.isBefore(endDate)) {
        return ClubRecruitmentStatus.OPEN;
    }
    
    // 모집 종료된 경우
    if (now.isAfter(endDate)) {
        return ClubRecruitmentStatus.CLOSED;
    }
    
    // 모집 시작 전인 경우
    long daysUntilStart = ChronoUnit.DAYS.between(now, startDate);
    if (daysUntilStart <= 14) {
        return ClubRecruitmentStatus.UPCOMING;
    }
    
    return ClubRecruitmentStatus.CLOSED;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1761642 and 94fcf7f.

📒 Files selected for processing (9)
  • backend/src/main/java/moadong/MoadongApplication.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/Club.java (2 hunks)
  • backend/src/main/java/moadong/club/entity/ClubRecruitmentInformation.java (1 hunks)
  • backend/src/main/java/moadong/club/service/ClubProfileService.java (3 hunks)
  • backend/src/main/java/moadong/club/service/RecruitmentScheduler.java (0 hunks)
  • backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (1 hunks)
  • backend/src/main/java/moadong/global/config/SchedulerConfig.java (0 hunks)
  • backend/src/test/java/moadong/club/service/RecruitmentSchedulerTest.java (0 hunks)
  • backend/src/test/java/moadong/club/service/RecruitmentStateCheckerTest.java (1 hunks)
💤 Files with no reviewable changes (3)
  • backend/src/main/java/moadong/global/config/SchedulerConfig.java
  • backend/src/main/java/moadong/club/service/RecruitmentScheduler.java
  • backend/src/test/java/moadong/club/service/RecruitmentSchedulerTest.java
🧰 Additional context used
🧬 Code Graph Analysis (1)
backend/src/main/java/moadong/club/service/ClubProfileService.java (1)
backend/src/main/java/moadong/global/util/ObjectIdConverter.java (1)
  • ObjectIdConverter (7-17)
🔇 Additional comments (15)
backend/src/main/java/moadong/MoadongApplication.java (1)

7-7: 스케줄링 기능 활성화 적용 완료

@EnableScheduling 어노테이션을 추가하여 Spring의 스케줄링 기능을 활성화했습니다. 이는 새로운 RecruitmentStateChecker 컴포넌트의 주기적인 실행을 지원하는 올바른 접근법입니다.

Also applies to: 11-11

backend/src/main/java/moadong/club/entity/Club.java (1)

13-13: 상태 업데이트 메서드 추가 적합

updateRecruitmentStatus 메서드가 적절히 구현되었습니다. 이 메서드를 통해 RecruitmentStateChecker에서 모집 상태를 쉽게 갱신할 수 있습니다.

Also applies to: 98-100

backend/src/main/java/moadong/club/entity/ClubRecruitmentInformation.java (2)

83-85: null 체크 추가로 안정성 향상

recruitmentStart가 null일 때의 처리를 추가하여 NPE(NullPointerException)을 방지하는 좋은 변경입니다. ZonedDateTime 변환 전 null 체크는 필수적입니다.


91-93: null 체크 추가로 안정성 향상

recruitmentEnd가 null일 때의 처리를 추가하여 NPE(NullPointerException)을 방지하는 좋은 변경입니다. ZonedDateTime 변환 전 null 체크는 필수적입니다.

backend/src/test/java/moadong/club/service/RecruitmentStateCheckerTest.java (5)

31-47: 테스트 케이스의 명확한 시나리오 처리

ALWAYS 상태의 동아리는 업데이트를 건너뛰는 시나리오가 잘 테스트되었습니다. Mock 객체 설정과 검증이 적절하게 작성되었습니다.


49-67: UPCOMING 상태 전환 테스트 적절

모집 시작 14일 이내에 UPCOMING 상태로 변경되는 시나리오가 잘 테스트되었습니다. 상태 변경과 저장 호출이 올바르게 검증되었습니다.


69-87: OPEN 상태 전환 테스트 적절

모집 기간 중 OPEN 상태로 변경되는 시나리오가 잘 테스트되었습니다. 상태 변경과 저장 호출이 올바르게 검증되었습니다.


89-107: CLOSED 상태 전환 테스트 적절

모집 기간 종료 후 CLOSED 상태로 변경되는 시나리오가 잘 테스트되었습니다. 상태 변경과 저장 호출이 올바르게 검증되었습니다.


109-124: null 날짜 처리 테스트 적절

시작일 또는 종료일이 null인 경우 CLOSED 상태로 변경되는 시나리오가 잘 테스트되었습니다. 이는 ClubRecruitmentInformation에 추가된 null 체크와 일관성 있게 동작합니다.

backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (1)

1-20: 클래스 설계가 적절합니다!

RecruitmentStateChecker 구조가 명확하게 설계되었습니다. 스프링 컴포넌트로 등록되고 생성자 주입을 통해 리포지토리를 주입받는 방식이 Spring의 권장 패턴을 따르고 있어 좋습니다.

backend/src/main/java/moadong/club/service/ClubProfileService.java (5)

8-8: 적절한 임포트 변경입니다.

클래스 의존성 업데이트가 올바르게 이루어졌습니다.


26-29: 코드 포맷팅 개선이 잘 적용되었습니다.

들여쓰기 수정이 일관되게 적용되어 가독성이 향상되었습니다.


42-47: RecruitmentScheduler 의존성 제거가 적절하게 이루어졌습니다.

이전 RecruitmentScheduler를 사용한 스케줄링 로직이 제거되고 코드가 단순화되었습니다. 이제 클럽 정보 업데이트만 수행하고 스케줄링은 RecruitmentStateChecker에서 일괄적으로 처리하는 방식으로 개선되었습니다.


49-58: 코드 포맷팅 개선이 잘 적용되었습니다.

들여쓰기 수정이 일관되게 적용되어 가독성이 향상되었습니다.


60-67: 메서드 시그니처 변경 및 포맷팅 개선이 잘 적용되었습니다.

validateClubUpdateRequest 메서드의 시그니처 변경과 들여쓰기 수정이 적절히 이루어졌습니다.

Comment on lines +22 to +30
public void performTask() {
List<Club> clubs = clubRepository.findAll();
for (Club club : clubs) {
ClubRecruitmentInformation recruitInfo = club.getClubRecruitmentInformation();
ZonedDateTime recruitmentStartDate = recruitInfo.getRecruitmentStart();
ZonedDateTime recruitmentEndDate = recruitInfo.getRecruitmentEnd();
if (recruitInfo.getClubRecruitmentStatus() == ClubRecruitmentStatus.ALWAYS) {
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

스케줄링 태스크 성능 보장을 위한 조치 필요

스케줄링 메서드에 트랜잭션 관리가 없습니다. DB 작업을 포함하는 스케줄링 태스크에서는 트랜잭션 관리가 중요합니다. 또한, 모든 클럽을 한번에 가져오는 방식은 클럽 수가 많아질 경우 성능 이슈가 발생할 수 있습니다.

@Scheduled(fixedRate = 60 * 60 * 1000) // 5분마다 실행
+ @Transactional
public void performTask() {
    List<Club> clubs = clubRepository.findAll();

추가적으로 페이징 처리를 고려해보세요:

public void performTask() {
    int pageSize = 100;
    int pageNumber = 0;
    Page<Club> clubsPage;
    
    do {
        Pageable pageable = PageRequest.of(pageNumber++, pageSize);
        clubsPage = clubRepository.findAll(pageable);
        processClubPage(clubsPage.getContent());
    } while (clubsPage.hasNext());
}

private void processClubPage(List<Club> clubs) {
    for (Club club : clubs) {
        // 현재 로직 구현
    }
}

Comment on lines +31 to +44
if (recruitmentStartDate != null && recruitmentEndDate != null) {
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
if (now.isBefore(recruitmentStartDate)) {
long between = ChronoUnit.DAYS.between(recruitmentStartDate, now);
if (between <= 14) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.UPCOMING);
} else {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
} else if (now.isAfter(recruitmentStartDate) && now.isBefore(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.OPEN);
} else if (now.isAfter(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

날짜 비교 로직 버그 수정 필요

34번 라인의 날짜 차이 계산 로직에 버그가 있습니다. between(recruitmentStartDate, now)는 시작일과 현재 시간의 차이를 음수로 계산합니다. 올바른 계산을 위해서는 순서를 바꿔야 합니다.

- long between = ChronoUnit.DAYS.between(recruitmentStartDate, now);
+ long between = ChronoUnit.DAYS.between(now, recruitmentStartDate);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (recruitmentStartDate != null && recruitmentEndDate != null) {
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
if (now.isBefore(recruitmentStartDate)) {
long between = ChronoUnit.DAYS.between(recruitmentStartDate, now);
if (between <= 14) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.UPCOMING);
} else {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
} else if (now.isAfter(recruitmentStartDate) && now.isBefore(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.OPEN);
} else if (now.isAfter(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
if (now.isBefore(recruitmentStartDate)) {
- long between = ChronoUnit.DAYS.between(recruitmentStartDate, now);
+ long between = ChronoUnit.DAYS.between(now, recruitmentStartDate);
if (between <= 14) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.UPCOMING);
} else {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}

Comment on lines +22 to +50
public void performTask() {
List<Club> clubs = clubRepository.findAll();
for (Club club : clubs) {
ClubRecruitmentInformation recruitInfo = club.getClubRecruitmentInformation();
ZonedDateTime recruitmentStartDate = recruitInfo.getRecruitmentStart();
ZonedDateTime recruitmentEndDate = recruitInfo.getRecruitmentEnd();
if (recruitInfo.getClubRecruitmentStatus() == ClubRecruitmentStatus.ALWAYS) {
continue;
}
if (recruitmentStartDate != null && recruitmentEndDate != null) {
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
if (now.isBefore(recruitmentStartDate)) {
long between = ChronoUnit.DAYS.between(recruitmentStartDate, now);
if (between <= 14) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.UPCOMING);
} else {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
} else if (now.isAfter(recruitmentStartDate) && now.isBefore(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.OPEN);
} else if (now.isAfter(recruitmentEndDate)) {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
} else {
club.updateRecruitmentStatus(ClubRecruitmentStatus.CLOSED);
}
clubRepository.save(club);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

예외 처리 추가 필요

DB 작업 중 발생할 수 있는 예외에 대한 처리가 없습니다. 스케줄링 작업은 백그라운드에서 실행되므로 예외 처리와 로깅이 특히 중요합니다.

@Scheduled(fixedRate = 60 * 60 * 1000) // 1시간마다 실행
public void performTask() {
+   try {
        List<Club> clubs = clubRepository.findAll();
        for (Club club : clubs) {
            // 기존 로직...
        }
+   } catch (Exception e) {
+       // 로깅 프레임워크 사용 (예: SLF4J)
+       log.error("Club recruitment status update failed", e);
+       // 필요한 경우 알림 시스템에 통보
+   }
}

Copy link
Member

@Zepelown Zepelown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다.

Copy link
Collaborator

@PororoAndFriends PororoAndFriends left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend 🐞 Bug Something isn't working 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants