-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Milestone
Description
0.7.0版本中对RedisScheduler
做了重构,使用了jedis.sadd
来直接进行去重。
但是sadd的javadoc如下:
Integer reply, specifically: 1 if the new element was added 0 if the element was already a member of the set
所以这里是用法反了,应该改为:
public boolean isDuplicate(Request request, Task task) {
Jedis jedis = pool.getResource();
try {
return jedis.sadd(getSetKey(task), request.getUrl()) == 0;
} finally {
pool.returnResource(jedis);
}
}