修复reddison不能批量删除的bug。

master
sxq 5 years ago
parent 2ee2e4505a
commit 0fe064b8a2

@ -96,8 +96,12 @@ public class RedisCache {
* @param collection * @param collection
* @return * @return
*/ */
public long deleteObject(final Collection collection) { public void deleteObject(final Collection collection) {
return redissonClient.getKeys().delete(Arrays.toString(collection.toArray())); RBatch batch = redissonClient.createBatch();
collection.forEach(t->{
batch.getBucket(t.toString()).deleteAsync();
});
batch.execute();
} }
/** /**

Loading…
Cancel
Save