cron: persona tick·답글을 하루 단위 멱등으로, 배포 대기창 6시간 → 4시간 - #37
Merged
Merged
Conversation
"왜 배포를 그렇게 늦게 하나" 에 대한 답. 12:14 KST 에 머지한 것이 14:00 까지 기다린 이유는 DEPLOY_QUIET_HOURS_KST="6 7 8 9 12 13" 이고, 그 목록이 긴 이유는 cron 하나가 재실행에 안전하지 않아서였다. swap 은 모든 cron 앱을 재등록하고 pm2 가 각각 1회 즉시 실행한다. 다른 cron 은 그걸 견딘다 — brief 는 날짜 PK, why-moved 는 pulse 집합 비교, calls 는 이미 call 있는 글을 건너뛴다. 그런데 persona-tick 은 그런 가드가 없어서 09시대에 swap 하면 그날 10개를 한 번 더 발행했다. persona-replies 도 페르소나별 캡(dailyCap/2)만 있어 두 번째 라운드가 들어갈 여지가 있었다. 두 스크립트가 이제 그날(KST) 이미 발행된 수를 세고 차이만큼만 쓴다: - persona-tick: 오늘 top-level agent 글이 --pages 이상이면 즉시 종료 - persona-replies: 오늘 답글이 --max 이상이면 즉시 종료 부수 효과로 중단된 실행이 이어진다 — 4개 쓰고 죽었으면 다음 실행이 6개를 채운다. 그래서 09·12 를 quiet 목록에서 뺀다. 남은 "6 7 8 13" 은 각 스크립트의 가드를 같은 방식으로 확인하지 않은 시간대다. 하나씩 검증하며 줄일 수 있다. 검증 (프로덕션 DB 사본, 오늘 이미 10개 발행된 상태): --pages=10 → "already posted 10/10 today — nothing to do." --pages=12 → "target=2 (10 already today, cap 12)" 로 2개만 답글 --max=8 → 오늘 0개였으므로 8개 (같은 가드가 반대 방향으로 동작) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"왜 배포를 그렇게 늦게 하나" 에 대한 답입니다.
12:14 KST 에 머지한 것이 14:00 까지 기다린 이유는
DEPLOY_QUIET_HOURS_KST="6 7 8 9 12 13"이고, 그 목록이 긴 이유는 cron 하나가 재실행에 안전하지 않아서였습니다.swap 은 모든 cron 앱을 재등록하고 pm2 가 각각 1회 즉시 실행합니다. 다른 cron 은 그걸 견딥니다 — brief 는 날짜 PK, why-moved 는 pulse 집합 비교, calls 는 이미 call 있는 글을 건너뜁니다. 그런데
persona-tick은 그런 가드가 없어서 09시대에 swap 하면 그날 10개를 한 번 더 발행했습니다.persona-replies도 페르소나별 캡(dailyCap/2)만 있어 두 번째 라운드가 들어갈 여지가 있었습니다.고침
두 스크립트가 그날(KST) 이미 발행된 수를 세고 차이만큼만 씁니다.
부수 효과로 중단된 실행이 이어집니다 — 4개 쓰고 죽었으면 다음 실행이 6개를 채웁니다.
그래서 09·12 를 quiet 목록에서 뺍니다. 남은
"6 7 8 13"은 각 스크립트의 가드를 같은 방식으로 확인하지 않은 시간대입니다. 하나씩 검증하며 줄일 수 있습니다.검증 (프로덕션 DB 사본, 오늘 이미 10개 발행된 상태)
--pages=12로그에priceable reserved 2와 첫 시도asset:sp500-etf가 보입니다 — #36 도 함께 작동합니다.tsc·next build·check-health·bash -nclean.🤖 Generated with Claude Code