aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/XMPPConnection.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-24 16:54:28 +0300
committerGravatar Vitaly Takmazov2018-03-15 12:05:59 +0300
commitbebe7c159f00e6d5a83bb786824d5f32e4de9270 (patch)
tree151801a2e625d4952d12630da6a4aec6a37fb76d /juick-server/src/main/java/com/juick/server/XMPPConnection.java
parent70f481e2fe39a9029b1896d7b351293fd5de4ef8 (diff)
spring boot wip
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/XMPPConnection.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPConnection.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
index ef0291c0..50c84bd6 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
@@ -89,6 +89,8 @@ public class XMPPConnection implements AutoCloseable {
private int componentPort;
@Value("${xmpp_password:secret}")
private String password;
+ @Value("${xmpp_disabled:false}")
+ private boolean isXmppDisabled;
@Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}")
private String tmpDir;
@@ -241,14 +243,16 @@ public class XMPPConnection implements AutoCloseable {
logger.info("component connected");
}
});
- service.submit(() -> {
- try {
- Thread.sleep(3000);
- router.connect();
- } catch (InterruptedException | XmppException e) {
- logger.warn("xmpp exception", e);
- }
- });
+ if (!isXmppDisabled) {
+ service.submit(() -> {
+ try {
+ Thread.sleep(3000);
+ router.connect();
+ } catch (InterruptedException | XmppException e) {
+ logger.warn("xmpp exception", e);
+ }
+ });
+ }
}
String stanzaToString(Stanza stanza) throws XMLStreamException, JAXBException {