From bebe7c159f00e6d5a83bb786824d5f32e4de9270 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 24 Feb 2018 16:54:28 +0300 Subject: spring boot wip --- .../main/java/com/juick/server/XMPPConnection.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server/XMPPConnection.java') 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 { -- cgit v1.2.3