فهرست منبع

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 سال پیش
والد
کامیت
130909da5e
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

+ 6 - 4
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -41,14 +41,16 @@ public class RedisThread implements Runnable {
        poolConfig.setMaxTotal(8);
        poolConfig.setMaxWaitMillis(-1);
        poolConfig.setMinIdle(1);
        JedisPool pool = new JedisPool(poolConfig,host,port,100000,password);
        JedisPool pool = null;
        if(StringUtils.isNotBlank(password)){
            pool = new JedisPool(poolConfig,host,port,100000,password);
        }else {
            pool = new JedisPool(poolConfig,host,port,100000);
        }
        while (true){
            try {
                Jedis jedis = pool.getResource();
//                if(StringUtils.isNotBlank(password)){
//                    jedis.auth(password);
//                }
                String message = jedis.rpop(key);
                if(StringUtils.isEmpty(message)){
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒