mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 02:56:53 +00:00
Jedis sanity checks
// FREEBIE
This commit is contained in:
1 parent
fac2f1bee3
commit
747b2dc7c5
1 file changed
+9
-1
@@ -5,6 +5,8 @@ import org.slf4j.LoggerFactory;
|
||||
import org.whispersystems.dispatch.DispatchChannel;
|
||||
import org.whispersystems.dispatch.DispatchManager;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import io.dropwizard.lifecycle.Managed;
|
||||
import static org.whispersystems.textsecuregcm.storage.PubSubProtos.PubSubMessage;
|
||||
import redis.clients.jedis.Jedis;
|
||||
@@ -63,7 +65,13 @@ public class PubSubManager implements Managed {
|
||||
|
||||
private boolean publish(byte[] channel, PubSubMessage message) {
|
||||
try (Jedis jedis = jedisPool.getResource()) {
|
||||
return jedis.publish(channel, message.toByteArray()) != 0;
|
||||
long result = jedis.publish(channel, message.toByteArray());
|
||||
|
||||
if (result < 0) {
|
||||
logger.warn("**** Jedis publish result < 0");
|
||||
}
|
||||
|
||||
return result > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user