mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 10:28:12 +01:00
Improve Redis exception handling
This commit is contained in:
@@ -18,7 +18,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.whispersystems.textsecuregcm.push.ApnMessage.Type;
|
||||
import org.whispersystems.textsecuregcm.redis.ClusterLuaScript;
|
||||
import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisCluster;
|
||||
import org.whispersystems.textsecuregcm.redis.RedisException;
|
||||
import org.whispersystems.textsecuregcm.storage.Account;
|
||||
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
||||
import org.whispersystems.textsecuregcm.storage.Device;
|
||||
@@ -135,27 +134,19 @@ public class ApnFallbackManager implements Managed {
|
||||
}
|
||||
}
|
||||
|
||||
public void schedule(Account account, Device device) throws RedisException {
|
||||
public void schedule(Account account, Device device) {
|
||||
schedule(account, device, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void schedule(Account account, Device device, long timestamp) throws RedisException {
|
||||
try {
|
||||
sent.mark();
|
||||
insert(account, device, timestamp + (15 * 1000), (15 * 1000));
|
||||
} catch (io.lettuce.core.RedisException e) {
|
||||
throw new RedisException(e);
|
||||
}
|
||||
void schedule(Account account, Device device, long timestamp) {
|
||||
sent.mark();
|
||||
insert(account, device, timestamp + (15 * 1000), (15 * 1000));
|
||||
}
|
||||
|
||||
public void cancel(Account account, Device device) throws RedisException {
|
||||
try {
|
||||
if (remove(account, device)) {
|
||||
delivered.mark();
|
||||
}
|
||||
} catch (io.lettuce.core.RedisException e) {
|
||||
throw new RedisException(e);
|
||||
public void cancel(Account account, Device device) {
|
||||
if (remove(account, device)) {
|
||||
delivered.mark();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user