From 44ba3b7526d3824758e94949b0ccbe1bedfe4089 Mon Sep 17 00:00:00 2001 From: icedream Date: Fri, 16 Oct 2015 10:25:19 +0200 Subject: [PATCH] Fixing TS3 query reconnection. If the first connection to the query interface fails, the app didn't try to connect again afterwards because it assumed that the process has been aborted intentionally. --- services/ts3client.iced | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/ts3client.iced b/services/ts3client.iced index be922db..7337ba0 100644 --- a/services/ts3client.iced +++ b/services/ts3client.iced @@ -126,12 +126,13 @@ module.exports = class TS3ClientService extends services.Service @query = new TS3ClientQuery "127.0.0.1", 25639 @_queryReconnectTimer = null @query.on "error", (err) => - if not @_requestedExit and @process and @process.connected - log.warn "Error in TS3 query connection, reconnecting..." + log.warn "Error in TS3 query connection", err + @query.on "close", => + if not @_requestedExit + log.warn "Connection to TS3 client query interface lost, reconnecting..." @_queryReconnectTimer = setTimeout @query.connect.bind(@query), 1000 else - log.warn "TS3 query connection terminated." - @query.on "close", => log.debug "Connection to TS3 client query interface lost." + log.debug "Connection to TS3 client query interface lost." @query.on "open", => log.debug "Connected to TS3 client query interface." @query.on "connecting", => log.debug "Connecting to TS3 client query interface..."