diff --git a/src/main/kotlin/org/gitanimals/render/domain/UserService.kt b/src/main/kotlin/org/gitanimals/render/domain/UserService.kt index f55ee71..0264459 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/UserService.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/UserService.kt @@ -49,6 +49,7 @@ class UserService( fun createNewUser(name: String, contributions: Map): User = userRepository.save(User.newUser(name, contributions)) + @Retryable(retryFor = [ObjectOptimisticLockingFailureException::class], maxAttempts = 100) @Transactional fun giveBonusPersona(id: Long, persona: String) { requireIdempotency("$id:bonus") @@ -58,6 +59,7 @@ class UserService( user.giveBonusPersona(persona) } + @Retryable(retryFor = [ObjectOptimisticLockingFailureException::class], maxAttempts = 100) @Transactional fun changePersona(id: Long, personChangeRequest: PersonaChangeRequest) { val user = getUserById(id)