mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-07 20:25:08 +02:00
RedisConnection#ReadLoop(): don't crash (silently) if a promise to be set is already set
This commit is contained in:
parent
50fee6aeb9
commit
732d5c472d
@ -413,12 +413,16 @@ void RedisConnection::ReadLoop(asio::yield_context& yc)
|
||||
throw;
|
||||
} catch (...) {
|
||||
promise.set_exception(std::current_exception());
|
||||
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
promise.set_value(std::move(replies));
|
||||
try {
|
||||
promise.set_value(std::move(replies));
|
||||
} catch (const std::future_error&) {
|
||||
// Complaint about the above op is not allowed
|
||||
// due to promise.set_exception() was already called
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user