diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ec1f8b..5009d03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (expandurl-mastodon - VERSION 0.8.0 + VERSION 0.8.1 LANGUAGES CXX ) diff --git a/src/main.cpp b/src/main.cpp index bee47d0..88b584c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,7 +75,6 @@ int main(int argc, char *argv[]) listener.stop(); syslog(LOG_DEBUG, "Reestablishing connection..."); listener.start(); - syslog(LOG_NOTICE, "Reestablished connection."); new_messages = listener.catchup(); } diff --git a/src/masto.cpp b/src/masto.cpp index c5d0298..ccf1600 100644 --- a/src/masto.cpp +++ b/src/masto.cpp @@ -112,6 +112,10 @@ const void Listener::start() { syslog(LOG_NOTICE, "Connected to %s", _instance.c_str()); } + else if (ret != 14) + { // If the stream thread sleeps, the main thread should sleep too + std::this_thread::sleep_for(std::chrono::seconds(60)); + } } const void Listener::stop() @@ -192,6 +196,10 @@ const std::vector Listener::catchup() v.push_back(Easy::Notification(str)); } } + else + { + syslog(LOG_ERR, "Could not catch up: Error %u", ret); + } } return v;