Skip to content

Commit

Permalink
Merge pull request #54 from catchroom/feature/refactor-chat
Browse files Browse the repository at this point in the history
refactor : restTemplate TTL ์„ค์ •
  • Loading branch information
sungjiwoon authored Jan 24, 2024
2 parents cecf9b0 + 9791d0b commit da3650a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


@Service
@RequiredArgsConstructor
@Slf4j
public class ChatRoomRepository {

Expand Down Expand Up @@ -46,11 +47,9 @@ public class ChatRoomRepository {
@Resource(name = "redisTemplate")
private ValueOperations<String, String> userInfoOps;

public ChatRoomRepository() {
lastChatMessage.expire(CHAT_ROOM_TEMPLATE, 1, TimeUnit.MINUTES);
}

public void setLastChatMessage(String roomId, ChatMessageDto chatMessageDto) {
lastChatMessage.expire(CHAT_ROOM_TEMPLATE, 1, TimeUnit.MINUTES);
opsHashLastChatMessage.put(CHAT_ROOM, roomId, chatMessageDto);
lastChatMessage.opsForHash().put(CHAT_ROOM_TEMPLATE, roomId, chatMessageDto);
}
Expand Down

0 comments on commit da3650a

Please sign in to comment.