fix(quota): 캐릭터 톡 채팅 쿼터 조회
- applyRefillOnEnterAndGetStatus를 적용하여 채팅 쿼터 조회 시 Lazy Refill 적용
This commit is contained in:
parent
84ebc1762b
commit
15d0952de8
|
@ -61,15 +61,9 @@ class ChatQuotaService(
|
|||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Transactional
|
||||
fun getStatus(memberId: Long): QuotaStatus {
|
||||
val q = repo.findByMemberId(memberId) ?: return QuotaStatus(
|
||||
totalRemaining = FREE_BUCKET,
|
||||
nextRechargeAtEpochMillis = null
|
||||
)
|
||||
val total = q.remainingFree + q.remainingPaid
|
||||
val epoch = q.nextRechargeAt?.atZone(ZoneId.systemDefault())?.toInstant()?.toEpochMilli()
|
||||
return QuotaStatus(totalRemaining = total, nextRechargeAtEpochMillis = epoch)
|
||||
return applyRefillOnEnterAndGetStatus(memberId)
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
Loading…
Reference in New Issue