Skip to content

Commit

Permalink
Fix : Lock time 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunw9 committed Jul 19, 2024
1 parent 559ef67 commit 68c8fe0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ public class RedisMessageListener implements MessageListener {
public void onMessage(Message message, byte[] pattern) {
String expiredKey = new String(message.getBody());
log.info("########## listen succeed ##########");
Long diaryId = Long.parseLong(expiredKey.split(":")[1]);

long diaryId = Long.parseLong(expiredKey.split(":")[1]);
log.info("expiredKey : {}", diaryId);

String lockKey = "lock:" + expiredKey;
if (redisLockService.tryLock(lockKey, 10, TimeUnit.SECONDS)) {
if (redisLockService.tryLock(lockKey, 30, TimeUnit.SECONDS)) {
try {
String nonExpiredKey = MESSAGE_KEY_PREFIX + diaryId;
String value = redisTemplate.opsForValue().get(nonExpiredKey);
Expand Down

0 comments on commit 68c8fe0

Please sign in to comment.