Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV-187] 레디스 세팅 업데이트 및 O-Lock Retry 횟수 증가 #86

Merged
merged 4 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
writetimeout: 5000
mime:
charset: UTF-8
data:
redis:
host: ${REDIS_HOST}
port: ${REDIS_PORT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
public class RedissonConfig {

private static final String REDISSON_HOST_PREFIX = "redis://";
@Value("${spring.redis.host}")
@Value("${spring.data.redis.host}")
private String host;
@Value("${spring.redis.port}")
@Value("${spring.data.redis.port}")
private int port;
@Value("${spring.redis.password}")
@Value("${spring.data.redis.password}")
private String password;

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.tiketeer.Tiketeer.domain.purchase.service.PurchaseCrudService;
import com.tiketeer.Tiketeer.domain.ticket.repository.TicketRepository;


public class TicketOptimisticLockConcurrencyService implements TicketConcurrencyService {

private final TicketRepository ticketRepository;
Expand All @@ -26,9 +25,9 @@ public TicketOptimisticLockConcurrencyService(TicketRepository ticketRepository,

@Override
@Retryable(
retryFor = OptimisticLockingFailureException.class,
backoff = @Backoff(delay = 100),
maxAttempts = 10
retryFor = OptimisticLockingFailureException.class,
backoff = @Backoff(delay = 100),
maxAttempts = 100
)
public void assignPurchaseToTicket(UUID ticketingId, UUID purchaseId, int ticketCount) throws
ConcurrencyFailureException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
@TestConfiguration
public class EmbeddedRedisConfig {

@Value("${spring.redis.host}")
@Value("${spring.data.redis.host}")
private String host;
@Value("${spring.redis.port}")
@Value("${spring.data.redis.port}")
private int port;

@Value("${spring.redis.maxmemory}")
Expand Down
6 changes: 4 additions & 2 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ spring:
application:
name: tiketeer
redis:
host: localhost
port: 6380
maxmemory: 10
main:
allow-bean-definition-overriding: true
data:
redis:
host: localhost
port: 6380

logging:
level:
Expand Down
Loading