This commit is contained in:
2021-05-08 23:08:21 +08:00
parent fc91057f5b
commit 6cc210a25e
4 changed files with 15 additions and 9 deletions

View File

@@ -188,16 +188,18 @@ public class RedisTools {
private static boolean init = false;
public static void initRedisPoolSub() {
if (init)
if (init) {
return;
}
init = true;
System.out.println("初始化订阅");
new Thread(new Runnable() {
@Override
public void run() {
Jedis jedis = getPoolRedis();
if (jedis != null)
if (jedis != null) {
jedis.psubscribe(new Consumer(), "*");
}
}
}).start();