Skip to content
Snippets Groups Projects
Commit 2ae1efc7 authored by Bartosz Ziemba's avatar Bartosz Ziemba
Browse files

Added heartbeat success checking

parent 5c79c13b
No related branches found
No related tags found
No related merge requests found
Pipeline #3892 passed
......@@ -27,8 +27,18 @@ void heartbeat_timer(const boost::system::error_code & /*e*/,
In our case however it is causing idle workers to be disconneted from RabbitMQ server.
We can use heartbeat function to send data in order to keep connection alive.
*/
connection->heartbeat();
//std::cout << "Sent heartbeat\n";
std::cout << "Sending heartbeat\n";
bool hb_result = connection->heartbeat();
if (hb_result)
{
std::cout << "Heartbeat successful\n";
}
else
{
std::cout << "Heartbeat failed\n";
}
t->expires_from_now(HEARTBEAT_TIMEOUT);
t->async_wait(boost::bind(heartbeat_timer,
boost::asio::placeholders::error,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment