Skip to content

Commit

Permalink
Challenge redislabs-training#4 solution and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Prickett committed May 30, 2020
1 parent 955f23e commit f394e5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ public CapacityReport getReport(Integer limit) {
@Override
public Long getRank(Long siteId) {
// START Challenge #4
return -2L;
try(Jedis jedis = jedisPool.getResource()) {
String key = RedisSchema.getCapacityRankingKey();
return jedis.zrevrank(key, String.valueOf(siteId));
}
// END Challenge #4
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public void getReport() {
}

// Challenge #4
@Ignore
@Test
public void getRank() {
CapacityDao dao = new CapacityDaoRedisImpl(jedisPool);
Expand Down

0 comments on commit f394e5a

Please sign in to comment.