Skip to content

Commit 323d8a4

Browse files
committed
fix: 알림 전송에 rate-limit 추가
1 parent a733aad commit 323d8a4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/notification/tasks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88

99
# 연결/인증 단계 실패만 재시도한다 — 메시지 전송이 시작된 뒤의 예외는 중복 발송 위험이 있다.
1010
# Gmail은 짧은 시간에 로그인이 몰리면 XOAUTH2를 일시 거부하므로 백오프가 필요하다.
11+
# rate_limit은 worker 단위이고 채널 공통 — 분당 90건대에서 Gmail이 차단했던 이력을 기준으로 여유를 뒀다.
12+
# 운영 중 조정은 배포 없이 `app.control.rate_limit(task_name, "30/m")`로 가능하다.
1113
@shared_task(
1214
ignore_result=True,
15+
rate_limit="60/m",
1316
autoretry_for=(SMTPAuthenticationError, SMTPConnectError),
1417
retry_backoff=30,
1518
retry_backoff_max=600,

0 commit comments

Comments
 (0)