Skip to content

fix: 공지 폴링 24시간 매 30분으로 확대 — 심야 공지 아침 몰림 해소 - #63

Merged
mindongdong merged 2 commits into
mainfrom
fix/notice-polling-24h-30min
Jul 6, 2026
Merged

fix: 공지 폴링 24시간 매 30분으로 확대 — 심야 공지 아침 몰림 해소#63
mindongdong merged 2 commits into
mainfrom
fix/notice-polling-24h-30min

Conversation

@mindongdong

@mindongdong mindongdong commented Jul 6, 2026

Copy link
Copy Markdown
Owner

배경

기존 공지 폴링은 0,1,9-23시 **매시 정각(17회/일)**이라 새벽 2~9시가 공백이었다. 그 사이 게시된 심야 버그픽스 공지가 9시 첫 폴링에 한꺼번에 몰려서 발송되는 문제가 있었다.

변경

  • CronTriggerminute="0,30"으로 변경 → 24시간 매 30분(48회/일) 폴링. 각 공지가 게시 후 ~30분 내 개별 발송된다.
  • 이 변경으로 미사용이 된 NOTICE_HOURS 상수 제거(+ 시작 로그 문구 갱신).

안전성

  • 재발송 없음: 신규 판정은 notice_state.last_identifier(Postgres 영속) 기반 전진-only 마커. 이번 변경은 Python 상수 수정뿐 DB 마이그레이션 없음 → 배포/재시작으로 기존 공지가 신규로 재처리되지 않는다.
  • 스팸/레이트리밋 무관: 폴링 빈도가 늘어도 사용자가 받는 메시지 수는 동일(같은 공지 정확히 1회). 평균 발송 지연만 30분→15분.
  • max_instances=1·coalesce=True 유지 → 중복 실행 차단.
  • 부하 무시 수준: 넥슨 앱키 호출 96콜/일(4req/s 용량의 0.03%).

문서 동기화

테스트

  • 전체 824 passed, ruff clean
  • CronTrigger(minute="0,30") 실측: 하루 48회 발화, 새벽 2:40 이후 3:00·3:30·4:00… 커버 확인

남은 것

  • 봇 재배포 후 새벽 공지 1건으로 개별 발송 눈확인

Summary by CodeRabbit

  • Bug Fixes

    • Updated notice alerts to run every 30 minutes across the full day, helping reduce delays and morning notification bursts.
    • Improved the notification schedule so updates are checked more consistently in KST.
  • Documentation

    • Aligned project docs and design notes with the new 24-hour, half-hour polling schedule for notice alerts.

기존 폴링(0,1,9-23시 매시 17회/일)은 새벽 2~9시가 공백이라, 그 사이 게시된
심야 버그픽스 공지들이 9시 첫 폴링에 한꺼번에 몰려 발송됐다.

CronTrigger를 minute="0,30"으로 바꿔 24시간 매 30분(48회/일) 폴링한다. 각 공지가
게시 후 ~30분 내 개별 발송된다. NOTICE_HOURS 상수는 미사용이 되어 제거.

dedup는 그대로: notice_state.last_identifier(영속) 기반 전진-only 마커라 배포/재시작으로
기존 공지가 재발송되지 않는다. max_instances=1·coalesce=True 유지. 폴링 빈도가 늘어도
메시지 수는 동일(같은 공지 1회)이고, 넥슨 앱키 부하는 96콜/일로 무시 수준.

문서 동기화: design §3.6·work-plan 실빌드 기록·ADR-0017 표(각각 6→17→24h 반영 누락분 포함).
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maple-mate Ready Ready Preview, Comment Jul 6, 2026 12:34am

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mindongdong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de56a678-6bcc-4ada-a39b-639793ca0edf

📥 Commits

Reviewing files that changed from the base of the PR and between 2a76584 and a585b97.

📒 Files selected for processing (1)
  • docs/work-plan.md
📝 Walkthrough

Walkthrough

The /공지알림 notification polling schedule is changed from specific hourly time slots to a rolling 24-hour cadence firing every 30 minutes (KST). The scheduler's cron trigger, constants, and startup log are updated, and three documentation files (ADR, work plan, design spec) are revised to match.

Changes

Notice Polling Cadence Update

Layer / File(s) Summary
Scheduler cadence implementation
maple_mate/notification/scheduler.py
NOTICE_HOURS is removed, NOTICE_MINUTE changes from 0 to "0,30", the CronTrigger for run_notice_job drops the hour argument, and the startup log text reflects the new "매 30분" schedule.
Documentation updates for new schedule
docs/adr/0017-notification-unification-and-dm-subscription.md, docs/work-plan.md, maple-discord-bot-design.md
ADR-0017, the work plan, and the design spec are updated to describe the 24-hour every-30-minute polling cadence in place of prior fixed-hour schedules.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Scheduler as start_scheduler
  participant Trigger as CronTrigger
  participant Job as run_notice_job

  Scheduler->>Trigger: register CronTrigger(minute="0,30")
  loop Every 30 minutes, 24h
    Trigger->>Job: trigger run_notice_job
  end
  Scheduler->>Scheduler: log "공지(매 30분)"
Loading

Related PRs: None mentioned.

Suggested labels: documentation, scheduler

Suggested reviewers: None specified.

Poem:

A rabbit hops on half-past clocks,
No more waiting for the hour that knocks,
Every thirty minutes, notices fly,
Through morning, noon, and midnight sky,
Docs and code now beat as one — 🐇⏰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 공지 폴링을 24시간 30분 간격으로 확대해 심야 공지 몰림을 해소하는 핵심 변경을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/notice-polling-24h-30min

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/work-plan.md (1)

23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale schedule reference: "6시각 폴링" contradicts the updated cadence.

Line 23 still says "/공지알림 6시각 폴링·baseline은 봇 가동 시 1주기 관찰.", but line 82 in the same file now documents the new 48회/일 (24시간 매 30분) cadence. This leaves two contradictory descriptions of the same feature within one document.

📝 Suggested fix
-**다음 작업 후보**: 구현 단계 종료 — 남은 것은 **봇 가동 시 라이브 검증**뿐. **Phase 5 운영 요약** 발송 1회(`scripts/trigger_ops_summary.py` — 앱키 빨강·"외 N종"·헬스 command 분해 눈 확인). `/잠재` G1 등업 라이브 확정은 봇 가동 시 `scripts/spike_potential.py` 1콜로 마무리. `/공지알림` 6시각 폴링·baseline은 봇 가동 시 1주기 관찰.
+**다음 작업 후보**: 구현 단계 종료 — 남은 것은 **봇 가동 시 라이브 검증**뿐. **Phase 5 운영 요약** 발송 1회(`scripts/trigger_ops_summary.py` — 앱키 빨강·"외 N종"·헬스 command 분해 눈 확인). `/잠재` G1 등업 라이브 확정은 봇 가동 시 `scripts/spike_potential.py` 1콜로 마무리. `/공지알림` 24시간 매 30분 폴링·baseline은 봇 가동 시 1주기 관찰.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/work-plan.md` at line 23, Update the stale schedule text in the
work-plan so the `/공지알림` polling description matches the current cadence
documented elsewhere in the same file. In the affected bullet under “다음 작업 후보,”
replace the old “6시각 폴링·baseline” wording with the new 48회/일 (24시간 매 30분)
cadence, keeping the rest of the note intact. Use the `/공지알림` and “baseline”
references to locate the exact sentence to edit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/work-plan.md`:
- Line 23: Update the stale schedule text in the work-plan so the `/공지알림`
polling description matches the current cadence documented elsewhere in the same
file. In the affected bullet under “다음 작업 후보,” replace the old “6시각 폴링·baseline”
wording with the new 48회/일 (24시간 매 30분) cadence, keeping the rest of the note
intact. Use the `/공지알림` and “baseline” references to locate the exact sentence
to edit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6a78dbf-ed77-4292-bf38-3177146da77f

📥 Commits

Reviewing files that changed from the base of the PR and between 6d798e4 and 2a76584.

📒 Files selected for processing (4)
  • docs/adr/0017-notification-unification-and-dm-subscription.md
  • docs/work-plan.md
  • maple-discord-bot-design.md
  • maple_mate/notification/scheduler.py

line 23의 과거 '다음 작업 후보' 스냅샷에 남아있던 '6시각' 빈도 수식어가 24시간 매 30분 주기와 모순 → 수식어만 제거.
@mindongdong

Copy link
Copy Markdown
Owner Author

@coderabbitai 지적 반영했습니다. docs/work-plan.md:23은 과거 '다음 작업 후보' 스냅샷이라 전체 최신화 대신 모순되던 6시각 빈도 수식어만 제거해 24시간 매 30분 주기와의 불일치를 해소했습니다 (commit).

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
sed -n '15,30p' docs/work-plan.md
git log --oneline -3 -- docs/work-plan.md

Length of output: 1640


🏁 Script executed:

#!/bin/bash
git show a585b97 -- docs/work-plan.md

Length of output: 1392


Confirmed. The commit removes the stale "6시각" modifier from the /공지알림 polling description on line 23, resolving the contradiction with the new 24-hour/30-minute cadence, while intentionally leaving the rest of that historical "다음 작업 후보" snapshot untouched. That's a reasonable, minimal fix for the inconsistency I flagged.

@mindongdong 확인했습니다, 감사합니다! 지적한 모순 부분이 정확히 해소되었네요.

(=^・ω・^=)ノ

@mindongdong
mindongdong merged commit 9a3276d into main Jul 6, 2026
6 checks passed
@mindongdong
mindongdong deleted the fix/notice-polling-24h-30min branch July 6, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant