|
@@ -26,6 +26,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -187,7 +188,7 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
|
|
|
log.info("quitRoomSuccess: roomId={}, userId={}", roomId, userId);
|
|
|
//防止幂等
|
|
|
StringBuffer sb = new StringBuffer(QUIT_ROOM_SUCCESS).append(roomId).append(userId);
|
|
|
- if (!redisTemplate.opsForValue().setIfAbsent(sb.toString(),userId)){
|
|
|
+ if (!redisTemplate.opsForValue().setIfAbsent(sb.toString(),userId,1l, TimeUnit.SECONDS)){
|
|
|
log.info("quitRoomSuccess break: roomId={}, userId={}", roomId, userId);
|
|
|
return;
|
|
|
}
|