mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-25 11:58:05 +01:00
Log keepalives for unsubscribed channels.
// FREEBIE
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package org.whispersystems.textsecuregcm.controllers;
|
||||
|
||||
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.PubSubManager;
|
||||
import org.whispersystems.textsecuregcm.websocket.WebsocketAddress;
|
||||
@@ -17,6 +19,8 @@ import io.dropwizard.auth.Auth;
|
||||
@Path("/v1/keepalive")
|
||||
public class KeepAliveController {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(KeepAliveController.class);
|
||||
|
||||
private final PubSubManager pubSubManager;
|
||||
|
||||
public KeepAliveController(PubSubManager pubSubManager) {
|
||||
@@ -33,6 +37,7 @@ public class KeepAliveController {
|
||||
account.getAuthenticatedDevice().get().getId());
|
||||
|
||||
if (!pubSubManager.hasLocalSubscription(address)) {
|
||||
logger.warn("***** No local subscription found for: " + address);
|
||||
context.getClient().close(1000, "OK");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user