aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-17 10:54:50 +0300
committerGravatar Vitaly Takmazov2018-05-17 11:18:45 +0300
commited2e863fe4acfdb5015b5514c3219bef8c215ff3 (patch)
tree4ea266d96b00080c95adf6d16c6cf45220090ad5 /juick-server
parent55625e2fdbf3b3776abd157c588b559b4aaf1ef8 (diff)
xmpp: fix cleanup of idle connections
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/build.gradle2
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPServer.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/juick-server/build.gradle b/juick-server/build.gradle
index c9d69192..7d177005 100644
--- a/juick-server/build.gradle
+++ b/juick-server/build.gradle
@@ -17,7 +17,7 @@ dependencies {
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'org.twitter4j:twitter4j-core:4.0.6'
- compile ('com.github.juick:com.juick.xmpp:658f8cf751') {
+ compile ('com.github.juick:com.juick.xmpp:9b7d8e07a9') {
exclude group: 'xmlpull'
}
compile 'xpp3:xpp3:1.1.4c'
diff --git a/juick-server/src/main/java/com/juick/server/XMPPServer.java b/juick-server/src/main/java/com/juick/server/XMPPServer.java
index bf8ed228..1ae2bbdf 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPServer.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPServer.java
@@ -392,14 +392,14 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
@Scheduled(fixedDelay = 10000)
public void cleanUp() {
Instant now = Instant.now();
- outConnections.keySet().stream().filter(c -> Duration.between(now, c.getUpdated()).toMinutes() > TIMEOUT_MINUTES)
+ outConnections.keySet().stream().filter(c -> Duration.between(c.getUpdated(), now).toMinutes() > TIMEOUT_MINUTES)
.forEach(c -> {
logger.info("closing idle outgoing connection to {}", c.to);
c.logoff();
outConnections.remove(c);
});
- inConnections.stream().filter(c -> Duration.between(now, c.updated).toMinutes() > TIMEOUT_MINUTES)
+ inConnections.stream().filter(c -> Duration.between(c.updated, now).toMinutes() > TIMEOUT_MINUTES)
.forEach(c -> {
logger.info("closing idle incoming connection from {}", c.from);
c.closeConnection();