From a2ce4ed725b540402f691c233a116baef50f8d12 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Thu, 15 Mar 2018 15:55:38 +0100 Subject: [PATCH] fix(i3): Reconnect i3 IPC socket on restart/error (#762) --- src/modules/i3.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/i3.cpp b/src/modules/i3.cpp index 56c2fb48..62ee8ca9 100644 --- a/src/modules/i3.cpp +++ b/src/modules/i3.cpp @@ -102,6 +102,13 @@ namespace modules { m_ipc->handle_event(); return true; } catch (const exception& err) { + try { + m_log.warn("%s: Attempting to reconnect socket (reason: %s)", name(), err.what()); + m_ipc->connect_event_socket(true); + m_log.info("%s: Reconnecting socket succeeded", name()); + } catch (const exception& err) { + m_log.err("%s: Failed to reconnect socket (reason: %s)", name(), err.what()); + } return false; } }