redis.clients.jedis.exceptions.JedisDataException: Please close pipeline or multi block before calling this method.
解决方法:
Pipeline pip = jedis.pipelined();
Response<Long> smsCount=pip.hincrBy(keyName, field, -count);
if(smsCount.get()<0){
}
修改:
Pipeline pip = jedis.pipelined();
Response<Long> smsCount=pip.hincrBy(keyName, field, -count);
pip.sync();//同步
if(smsCount.get()<0){
}
本文链接:http://www.yayihouse.com/yayishuwu/chapter/1668