Skip to content

Commit

Permalink
[FIX] auctionId 통해 member 조회 - zset에서 set으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
CessnaJ committed Jan 21, 2024
1 parent 1922825 commit 1712c94
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.data.domain.Range;
import org.springframework.data.redis.connection.RedisZSetCommands;
import org.springframework.data.redis.core.ReactiveRedisTemplate;
import org.springframework.data.redis.core.ReactiveSetOperations;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;

Expand All @@ -15,11 +16,12 @@
@Service
public class RedisUtilService {
private final ReactiveRedisTemplate<String, Long> reactiveRedisTemplate;
private final ReactiveSetOperations<String, Long> reactiveSetOperations;

public Flux<Long> fetchAllAuctionMemberIds(String auctionId) {
return reactiveRedisTemplate.opsForZSet()
.reverseRangeByScore(auctionId, Range.<Double>unbounded(), RedisZSetCommands.Limit.unlimited());
return reactiveSetOperations.members(auctionId)
.doOnNext(memberId -> log.info("Fetched auction member ID: {}", memberId))
.doOnError(error -> log.error("Error fetching auction member IDs for Auction ID: {}, error: {}", auctionId, error.getMessage()))
.doOnComplete(() -> log.info("Completed fetching auction member IDs for Auction ID: {}", auctionId));
}


}

0 comments on commit 1712c94

Please sign in to comment.