Skip to content

fix(characters): 생성 취소 시 일일 생성 횟수 환불 누락 수정 - #85

Merged
bigmooon merged 2 commits into
mainfrom
fix/character-cancel-refund
Jun 25, 2026
Merged

bigmooon merged 2 commits into
mainfrom
fix/character-cancel-refund

Conversation

@JeongSW123

Copy link
Copy Markdown
Collaborator

Summary

  • 취소 뷰가 status=FAILED 만 찍고 환불은 태스크 체크포인트에만 의존해, 워커 유실·폴링 직후 저장 구간 레이스·이미 종료된 잡 등에서 차감된 ImgGenLog 가 남아 생성 횟수가 잘못 올라가던 문제 수정.

Changes

Checklist

  • Django app/module boundaries are respected (apps/, common/, config/, infrastructure/)
  • Settings use config.settings.*
  • Migrations are included or not needed
  • API behavior, serializers, permissions, or validation changes are documented
  • Tests are added/updated or the reason is noted

Test

  • make test
  • make lint
  • Manual check:

Notes

취소 뷰가 status=FAILED 만 찍고 환불은 태스크 체크포인트에만 의존해,
워커 유실·폴링 직후 저장 구간 레이스·이미 종료된 잡 등에서 차감된
ImgGenLog 가 남아 생성 횟수가 잘못 올라가던 문제 수정.

- CharacterGenerationJob 에 img_gen_log_id 추가(취소 뷰가 환불 대상 식별)
- 취소 뷰: 잡 행 잠금(select_for_update) + ImgGenLog 즉시 삭제
- 태스크 성공 저장: 잡 잠금 후 상태 재확인 → 취소면 폐기·환불(레이스 차단)
- 회귀 테스트: 취소→used 환불(0), 완료 잡 취소 409·횟수 유지
@JeongSW123
JeongSW123 requested a review from bigmooon June 25, 2026 01:51
@bigmooon
bigmooon merged commit 9997398 into main Jun 25, 2026
1 check passed
@JeongSW123
JeongSW123 deleted the fix/character-cancel-refund branch June 25, 2026 06:42
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.

2 participants