Fix MPD, add missing while loop

This commit is contained in:
Alex 2020-08-06 21:57:02 +02:00 committed by GitHub
parent 4d6e20a96d
commit a446cd692d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 14 deletions

View File

@ -63,6 +63,7 @@ auto waybar::modules::MPD::update() -> void {
std::thread waybar::modules::MPD::event_listener() { std::thread waybar::modules::MPD::event_listener() {
return std::thread([this] { return std::thread([this] {
while (true) {
try { try {
if (connection_ == nullptr) { if (connection_ == nullptr) {
// Retry periodically if no connection // Retry periodically if no connection
@ -79,6 +80,7 @@ std::thread waybar::modules::MPD::event_listener() {
spdlog::warn("{}: {}", module_name_, e.what()); spdlog::warn("{}: {}", module_name_, e.what());
} }
} }
}
}); });
} }