From 2e7fa6440b299d59339e58ec413516104954f7aa Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Mon, 15 Oct 2018 15:08:15 +0100 Subject: [PATCH] Do not spawn WS thread if it's disabled --- src/api/notifications.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/api/notifications.rs b/src/api/notifications.rs index 692efcfa..d5707f0c 100644 --- a/src/api/notifications.rs +++ b/src/api/notifications.rs @@ -360,12 +360,14 @@ pub fn start_notification_server() -> WebSocketUsers { let factory = WSFactory::init(); let users = factory.users.clone(); - thread::spawn(move || { - WebSocket::new(factory) - .unwrap() - .listen(&CONFIG.websocket_url) - .unwrap(); - }); + if CONFIG.websocket_enabled { + thread::spawn(move || { + WebSocket::new(factory) + .unwrap() + .listen(&CONFIG.websocket_url) + .unwrap(); + }); + } users }