Skip to content

[IDLE-567] 배치 pageIndex * 채팅 목록 버그 수정#271

Merged
mjj111 merged 3 commits intodevelopfrom
fix/IDLE-567
Apr 25, 2025
Merged

[IDLE-567] 배치 pageIndex * 채팅 목록 버그 수정#271
mjj111 merged 3 commits intodevelopfrom
fix/IDLE-567

Conversation

@mjj111
Copy link
Copy Markdown
Member

@mjj111 mjj111 commented Apr 25, 2025

1. 📄 Summary

  • 쿼리 오타 수정
  • pageIndex 초기화 오류 수정
  • 배치 관련 코드 스타일 변경

2. 💡 알게된 점, 궁금한 점

  • Spring Batch에서 멀티스레딩을 적용한 결과, Reader 단계에서 각 스레드가 동시에 reader 메서드를 호출한다는 점을 확인했습니다. 이로 인해 공유되고 있던 pageIndex 값이 스레드 간에 충돌하는 문제가 발생했으며, 이를 통해 pageIndex 초기화 문제의 원인을 파악하고 해결할 수 있었습니다.

Summary by CodeRabbit

  • 신규 기능

    • 오류 기록 및 출력 기능을 제공하는 ErrorRecorder가 추가되었습니다.
    • Worknet 페이지 파싱 및 크롤링을 담당하는 WorknetPageParser, WorknetPostParser 클래스가 도입되었습니다.
  • 버그 수정

    • 채팅방 조회 시 읽지 않은 메시지 필터의 컬럼명이 올바르게 수정되어, 수신자 기준 필터가 정확히 동작합니다.
  • 리팩터링

    • 기존 크롤러 기반 로직이 파서 기반 구조로 전면 교체되어 코드 구조가 간소화되고 유지보수가 용이해졌습니다.
    • PostingReader가 파서 클래스를 활용하도록 개선되었습니다.
  • 기타

    • 불필요한 import 및 변수 초기화 코드가 제거되었습니다.

@mjj111 mjj111 added the 🛠️버그 버그 제보 및 해결 label Apr 25, 2025
@mjj111 mjj111 self-assigned this Apr 25, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 25, 2025

Walkthrough

이 변경 사항은 기존의 크롤러 기반 클래스(WorknetPageCrawler, WorknetPostCrawler)를 파서 기반 클래스(WorknetPageParser, WorknetPostParser)로 대체하는 리팩토링을 수행합니다. 오류 기록을 위한 ErrorRecorder 클래스가 새롭게 도입되었으며, PostingReader는 페이지 및 게시물 정보를 파서 클래스를 통해 관리하도록 변경되었습니다. 또한, SQL 쿼리의 컬럼명이 데이터베이스 스키마에 맞게 수정되었습니다. 일부 불필요한 import 및 변수도 제거되었습니다.

Changes

파일/경로 변경 요약
.../crawler/ErrorRecorder.kt 오류 발생 위치별 카운트를 기록하고 출력하는 ErrorRecorder 클래스 추가
.../crawler/WorknetPageParser.kt
.../crawler/WorknetPostParser.kt
Selenium 기반 파서 클래스(WorknetPageParser, WorknetPostParser) 추가. 페이지 및 게시물 파싱 기능 구현
.../crawler/WorknetPageCrawler.kt
.../crawler/WorknetPostCrawler.kt
기존 크롤러 클래스(WorknetPageCrawler, WorknetPostCrawler) 전체 삭제
.../step/PostingReader.kt 크롤러 기반 로직을 파서 기반 로직으로 리팩토링. 상태 변수 제거, 파서 클래스 활용, 메서드 및 필드 정리
.../job/JobConfig.kt 사용하지 않는 import 및 nextPage 관련 코드 제거
.../chat/repository/ChatRoomRepository.kt 네이티브 쿼리의 컬럼명 receiverIdreceiver_id로 수정

Sequence Diagram(s)

sequenceDiagram
    participant Reader as PostingReader
    participant PageParser as WorknetPageParser
    participant PostParser as WorknetPostParser

    Reader->>PageParser: isOverPage(pageIndex)
    alt 페이지 있음
        Reader->>PageParser: getFetchCount(pageIndex)
        Reader->>PageParser: getAccessURL(pageIndex)
        Reader->>PostParser: crawlPosts(fetchCount, url)
        PostParser-->>Reader: List<CrawledJobPostingDto>
        Reader-->>Caller: List<CrawledJobPostingDto>
    else 페이지 없음
        Reader->>PageParser: (reset pageIndex)
        Reader-->>Caller: null
    end
Loading

Suggested labels

🎯리팩토링

✨ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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.

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.

@mjj111 mjj111 changed the title [IDLE- 567] [IDLE- 567] 배치 pageIndex * 채팅 목록 버그 수정 Apr 25, 2025
@mjj111 mjj111 changed the title [IDLE- 567] 배치 pageIndex * 채팅 목록 버그 수정 [IDLE-567] 배치 pageIndex * 채팅 목록 버그 수정 Apr 25, 2025
@sonarqubecloud
Copy link
Copy Markdown

coderabbitai[bot]

This comment was marked as resolved.

@mjj111 mjj111 merged commit 3a93a67 into develop Apr 25, 2025
5 of 7 checks passed
@mjj111 mjj111 deleted the fix/IDLE-567 branch April 25, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️버그 버그 제보 및 해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant