Jedis sanity checks

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-12-03 16:40:04 -08:00
parent fac2f1bee3
commit 747b2dc7c5
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}
}