parent
843b16c1f0
commit
1fcd1e33c5
|
@ -1,6 +1,8 @@
|
||||||
package org.whispersystems.textsecuregcm.controllers;
|
package org.whispersystems.textsecuregcm.controllers;
|
||||||
|
|
||||||
import com.codahale.metrics.annotation.Timed;
|
import com.codahale.metrics.annotation.Timed;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.whispersystems.textsecuregcm.storage.Account;
|
import org.whispersystems.textsecuregcm.storage.Account;
|
||||||
import org.whispersystems.textsecuregcm.storage.PubSubManager;
|
import org.whispersystems.textsecuregcm.storage.PubSubManager;
|
||||||
import org.whispersystems.textsecuregcm.websocket.WebsocketAddress;
|
import org.whispersystems.textsecuregcm.websocket.WebsocketAddress;
|
||||||
|
@ -17,6 +19,8 @@ import io.dropwizard.auth.Auth;
|
||||||
@Path("/v1/keepalive")
|
@Path("/v1/keepalive")
|
||||||
public class KeepAliveController {
|
public class KeepAliveController {
|
||||||
|
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(KeepAliveController.class);
|
||||||
|
|
||||||
private final PubSubManager pubSubManager;
|
private final PubSubManager pubSubManager;
|
||||||
|
|
||||||
public KeepAliveController(PubSubManager pubSubManager) {
|
public KeepAliveController(PubSubManager pubSubManager) {
|
||||||
|
@ -33,6 +37,7 @@ public class KeepAliveController {
|
||||||
account.getAuthenticatedDevice().get().getId());
|
account.getAuthenticatedDevice().get().getId());
|
||||||
|
|
||||||
if (!pubSubManager.hasLocalSubscription(address)) {
|
if (!pubSubManager.hasLocalSubscription(address)) {
|
||||||
|
logger.warn("***** No local subscription found for: " + address);
|
||||||
context.getClient().close(1000, "OK");
|
context.getClient().close(1000, "OK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue